Skip to content

Commit

Permalink
Update docs to say just boa -c path in most cases
Browse files Browse the repository at this point in the history
  • Loading branch information
madeline-scyphers committed Jul 19, 2024
1 parent 979df83 commit 28244f5
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion boa/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def main():

# Main entry point
# Can be invoked with `python -m boa`
# or just `boa` (see pypoject.toml`
# or just `boa` (see pypoject.toml`)
_main()


Expand Down
4 changes: 3 additions & 1 deletion boa/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
Plotting & EDA CLI
###################################
You can launch a basic EDA plot view
You can launch a basic EDA plot dashboard view
of your optimization with::
boa.plot path/to/scheduler.json
or
python -m boa.plot path/to/scheduler.json
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/1run_r_streamlined.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1507,13 +1507,13 @@
"To run our script we just need to path the config file to BOA's CLI\n",
"\n",
"```python\n",
"python -m boa --config-file path/to/config.yaml\n",
"boa --config-file path/to/config.yaml\n",
"```\n",
"\n",
"or\n",
"\n",
"```python\n",
"python -m boa -c path/to/config.yaml\n",
"boa -c path/to/config.yaml\n",
"```"
]
},
Expand Down Expand Up @@ -1891,7 +1891,7 @@
}
],
"source": [
"output = !python -m boa -c {config_path} # we capture ipython terminal output to python variable\n",
"output = !boa -c {config_path} # we capture ipython terminal output to python variable\n",
"o = \"\\n\".join(ln for ln in output) # it comes in as a list, we convert to string\n",
"o = o.replace(str(r_dir), \"[/path/to/your/dir/]\") # replace the actual dir with a stand in for privacy reasons\n",
"Code(o)"
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/2EDA_from_r_run.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"From the command line, we can issue\n",
"\n",
"```python\n",
"python -m boa.plot --scheduler-path path/to/scheduler.json\n",
"boa.plot --scheduler-path path/to/scheduler.json\n",
"\n",
"or\n",
"\n",
"python -m boa.plot -sp path/to/scheduler.json\n",
"boa.plot -sp path/to/scheduler.json\n",
"```\n",
"\n",
"```{attention} \n",
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/example_py_run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You can start and run your optimization like this:

.. code-block:: console
$ python -m boa -c config.json
$ boa -c config.json
Start time: 20221026T210522
[INFO 10-26 21:05:22] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x0. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.
[INFO 10-26 21:05:22] ax.service.utils.instantiation: Inferred value type of ParameterType.FLOAT for parameter x1. If that is not the expected value type, you can explicity specify 'value_type' ('int', 'float', 'bool' or 'str') in parameter dict.
Expand Down
4 changes: 0 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ Key features
- Customizable objective functions, multi-objective optimization, acquisition functions, etc
- Choice of built-in evaluation metrics, but it’s also easy to implement custom metrics

.. important::

This site is still under construction. More content will be added soon!

Contents
--------
.. toctree::
Expand Down
18 changes: 14 additions & 4 deletions docs/user_guide/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Here are instructions on how to install python through Anaconda or miniconda:
Install boa
===========

If using conda and you don't already have a dedicated conda environment for your model::
If using conda and you don't already have a dedicated conda environment for your model (if using mamba, replace all conda calls with mamba)::

conda create -n boa
conda activate boa
Expand All @@ -42,11 +42,11 @@ or if not using Python, make sure you have a virtual environment create::
and activate the virtual environment,
on windows::

venv\Scripts\activate.bat
. venv\Scripts\activate.bat

on linux and mac::

source tutorial-env/bin/activate
. venv/bin/activate

Once your environment is activated, if using conda, run::

Expand Down Expand Up @@ -78,6 +78,10 @@ so if on either of those, it should install pytorch>2 by default
but if not and something doesn't work, upgrade pytorch, torchvision,
and torchaudio

and then activate this environment::

conda activate boa-dev

:doc:`/contributing`

********
Expand All @@ -86,10 +90,16 @@ Test run

Once everything is installed, run the test script to ensure everything is install properly::

python -m boa.scripts.run_branin
boa.scripts.run_branin

If this test case runs successfully, you can move on to the next steps.

If you encounter a problem, make sure you environment that you install boa into is activated (`conda activate boa`, `. venv/bin/activate`, or `. venv\Scripts\activate.bat` for conda or pip (unix or windows), see above)), and then try again. If it still doesn't work, you can try::

python -m boa.scripts.run_branin

If this works, it may mean it installed an older version of BOA or that the boa command is not found on your path. If this works, you should be able to run boa commands by using the `python -m boa` instead of just `boa` and the plot command with `python -m boa.plot`.

**********
Update BOA
**********
Expand Down
12 changes: 6 additions & 6 deletions docs/user_guide/package_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Creating a Python launch script (Usually Not Needed)
****************************************************

Most of the time you won't need to write a launch script because BOA has an built-in launch script in
its :mod:`.controller` that is called when calling `python -m boa`. But if you do need more control over your launch script than the default
its :mod:`.controller` that is called when calling `boa`. But if you do need more control over your launch script than the default
provides, you can either subclass :class:`.Controller` or write your own launch script. Subclassing
:class:`.Controller` might be easier if you just need to modify :meth:`.Controller.run` or :meth:`.Controller.initialize_wrapper` or :meth:`.Controller.initialize_scheduler`
but can utilize the rest of the functions. If you need a lot of customization, writing your own script might be
Expand All @@ -63,24 +63,24 @@ you can start your run easily from the command line.

With your conda environment for boa activated, run::

python -m boa --config-path path/to/your/config/file
boa --config-path path/to/your/config/file

or::

python -m boa -c path/to/your/config/file
boa -c path/to/your/config/file

:doc:`BOA's </index>` will save the its current state automatically to a `scheduler.json` file in your output experiment directory every 1-few trials (depending on parallelism settings). It will also save a optimization.csv at the end of your run with the trial information as well in the same directory as scheduler.json. The console will output the Output directory at the start and end of your runs to the console, it will also throughout the run, whenever it saves the `scheduler.json` file, output to the console the location where the file is being saved. You can resume a stopped run from a scheduler file::

python -m boa --scheduler-path path/to/your/scheduler.json
boa --scheduler-path path/to/your/scheduler.json

or::

python -m boa -sp path/to/your/scheduler.json
boa -sp path/to/your/scheduler.json


For a list of options and descriptions, type::

python -m boa --help
boa --help

A fuller example using the command line interface can be found :doc:`here </examples/example_py_run>`

Expand Down

0 comments on commit 28244f5

Please sign in to comment.