Skip to content

Commit 589867a

Browse files
ldworkinfacebook-github-bot
authored andcommitted
SQA should not be required, part 2
Summary: updating docs Reviewed By: sdsingh Differential Revision: D15169838 fbshipit-source-id: a9064e30e9d2f7f6f1b446c43cc66ba84cea4458
1 parent 67e04ab commit 589867a

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

docs/storage.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,39 +76,41 @@ create_all_tables(engine)
7676
Then save your experiment:
7777
```py
7878
from ax import Experiment
79-
from ax import sqa_store
79+
from ax.storage.sqa_store.save import save_experiment
8080

8181
experiment = Experiment(...)
82-
sqa_store.save(experiment)
82+
save_experiment(experiment)
8383
```
8484

8585
The experiment (including attached data) will be saved to the corresponding tables.
8686

8787
Alternatively, you can pass a [creator function](https://docs.sqlalchemy.org/en/latest/core/engines.html#sqlalchemy.create_engine.params.creator) instead of a url to `init_engine_and_session_factory`:
8888

8989
```py
90-
from ax import Experiment, sqa_store
90+
from ax import Experiment
9191
from ax.storage.sqa_store.db import init_engine_and_session_factory
92+
from ax.storage.sqa_store.save import save_experiment
9293

9394
init_engine_and_session_factory(creator=creator)
9495
experiment = Experiment(...)
95-
sqa_store.save(experiment)
96+
save_experiment(experiment)
9697
```
9798

9899
### Updating
99100

100-
To update a SQL-backed experiment, call `sqa_store.save(experiment)` again. Ax will determine what updates to perform.
101+
To update a SQL-backed experiment, call `save_experiment(experiment)` again. Ax will determine what updates to perform.
101102

102103
### Loading
103104

104105
To load an experiment from SQL, specify the name:
105106

106107
```py
107-
from ax import Experiment, sqa_store
108+
from ax import Experiment
108109
from ax.storage.sqa_store.db import init_engine_and_session_factory
110+
from ax.storage.sqa_store.load import load_experiment
109111

110112
init_engine_and_session_factory(url=dialect+driver://username:password@host:port/database)
111-
experiment = sqa_store.load(experiment_name)
113+
experiment = load_experiment(experiment_name)
112114
```
113115

114116
### Customizing
@@ -138,15 +140,16 @@ If you choose to add types to your experiments, create an enum mapping experimen
138140

139141

140142
```py
141-
from ax import Experiment, sqa_store
143+
from ax import Experiment
144+
from ax.storage.sqa_store.save import save_experiment
142145
from ax.storage.sqa_store.sqa_config import SQAConfig
143146
from enum import Enum
144147

145148
class ExperimentType(Enum):
146149
DEFAULT: 0
147150

148151
config = SQAConfig(experiment_type_enum=ExperimentType)
149-
sqa_store.save(experiment, config=config)
152+
save_experiment(experiment, config=config)
150153
```
151154

152155
**Specifying generator run types:**
@@ -155,7 +158,8 @@ If you choose to add types to your generator runs (beyond the existing `status_q
155158

156159

157160
```py
158-
from ax import Experiment, sqa_store
161+
from ax import Experiment
162+
from ax.storage.sqa_store.save import save_experiment
159163
from ax.storage.sqa_store.sqa_config import SQAConfig
160164
from enum import Enum
161165

@@ -164,5 +168,5 @@ class GeneratorRunType(Enum):
164168
STATUS_QUO: 1
165169

166170
config = SQAConfig(generator_run_type_enum=GeneratorRunType)
167-
sqa_store.save(experiment, config=config)
171+
save_experiment(experiment, config=config)
168172
```

0 commit comments

Comments
 (0)