Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document updates #824

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ __pycache__/
*.py[cod]
*$py.class

#autogenerated slurm scripts
*.sh

# C extensions
*.so

Expand Down
6 changes: 2 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@

# Define path to the code to be documented **relative to where conf.py (this file) is kept**
sys.path.insert(0, os.path.abspath("../src/"))
from pkg_resources import get_distribution

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information


copyright = "2023"
copyright = "2024"
project = "Sorcha"
author = "Sorcha development team"
release = version("sorcha")
Expand All @@ -29,7 +28,7 @@
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ["sphinx.ext.mathjax", "sphinx.ext.napoleon", "sphinx.ext.viewcode"]
extensions = ["sphinx.ext.mathjax", "sphinx.ext.napoleon", "sphinx.ext.viewcode", "sphinx_exec_directive"]

extensions.append("autoapi.extension")
extensions.append("nbsphinx")
Expand All @@ -40,7 +39,6 @@
master_doc = "index" # This assumes that sphinx-build is called from the root directory
html_show_sourcelink = False # Remove 'view source code' from top of page (for html, not python)
add_module_names = False # Remove namespaces from class/method signatures

autoapi_type = "python"
autoapi_dirs = ["../src"]
autoapi_ignore = ["*/__main__.py", "*/_version.py"]
Expand Down
78 changes: 6 additions & 72 deletions docs/configfiles.rst

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions docs/gettingstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,17 @@ will produce
.. literalinclude:: ./example_files/help_output.txt
:language: text

Now that you know how to provide the input files, let's go run a simulation::
Now that you know how to provide the input files, let's go run a simulation: You can find the command to run the sorcha demo on the command line in two ways. First on the command line::

sorcha_demo_command

Or you can in an interactive python session or jupyter notebook. You can run the following

.. exec::

from sorcha.utilities.sorcha_demo_command import get_demo_command
print(get_demo_command())

sorcha -c ./demo/sorcha_config_demo.ini -p ./demo/sspp_testset_colours.txt -ob ./demo/sspp_testset_orbits.des -pd ./demo/baseline_v2.0_1yr.db -o ./ -t testrun_e2e -ar ./ar_files

.. tip::
Sorcha outputs a log file (*.sorcha.log) and error file (*.sorcha.err) in the output directory. If all has gone well, the error file will be empty. The log file has the configuration parameters outputted to it as a record of the run setup.
Expand Down
2 changes: 0 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,3 @@ works, tutorials, and demonstration notebooks that show how each of the various
acknowledgements
cite
uninstall


4 changes: 2 additions & 2 deletions docs/inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ An example of an orbit file in Cometary format::
+=============+==================================================================================+
| objID | Object identifier for each synthetic planetesimal simulated (string) |
+-------------+----------------------------------------------------------------------------------+
| FORMAT | Orbit format string (COM for heliocentric or BCOM for barycentric) |
| FORMAT | Orbit format string (COM for heliocentric or BCOM for barycentric) |
+-------------+----------------------------------------------------------------------------------+
| q | Perihelion (au) |
| q | Perihelion (au) |
+-------------+----------------------------------------------------------------------------------+
| e | Eccentricity |
+-------------+----------------------------------------------------------------------------------+
Expand Down
11 changes: 9 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,16 @@ To install the necessary SPICE auxiliary files for ephemeris generation (774 MB
Testing Your Sorcha Installation
----------------------------------

You can check that the Sorcha installation was done correctly, by downloading the Sorcha source code repository (Steps 1-4 **only** of :ref:`dev_mode`) and then running::
You can check that the Sorcha installation was done correctly, by downloading the Sorcha source code repository (Steps 1-4 **only** of :ref:`dev_mode`) and then running the demo command. You can find the command to run the sorcha demo on the command line in two ways. First on the command line::

sorcha -c ./demo/sorcha_config_demo.ini -p ./demo/sspp_testset_colours.txt -ob ./demo/sspp_testset_orbits.des -pd ./demo/baseline_v2.0_1yr.db -o ./ -t testrun_e2e
sorcha_demo_command

Or you can in an interactive python session or jupyter notebook. You can run the following

.. exec::

from sorcha.utilities.sorcha_demo_command import get_demo_command
print(get_demo_command())

The output will appear in a csv file (testrun_e2e.csv) in your current directory. The first 51 lines of the csv file should look like this:

Expand Down
2 changes: 2 additions & 0 deletions docs/notebooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ Notebooks
Uncertainties and Randomization <notebooks/demo_UncertaintiesAndRandomization>
Vignetting Demo <notebooks/demo_Vignetting>
Lightcurve demo <notebooks/demo_Lightcurve>
Example Bash Scripts for Multiple Runs <notebooks/demo_GenerateBashScripts>
Example Slurm Scripts for Multiple Runs <notebooks/demo_GenerateSLURMScripts>
4 changes: 3 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ pytest
pytest-cov
astropy
astroquery
sorcha
scipy
sbpy
matplotlib
sphinx
sphinx-rtd-theme
sphinx-autoapi
sphinx-exec-directive
nbsphinx
ipython
jupytext
jupyter
sorcha-addons
importlib_resources
importlib_resources
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ dev = [
"pre-commit", # Used to run checks before finalizing a git commit
"sphinx", # Used to automatically generate documentation
"sphinx-rtd-theme", # Used to render documentation
"sphinx-exec-directive", # running sphinx python commands in documentation
"sphinx-autoapi", # Used to automatically generate api documentation
"black", # Used for static linting of files
# if you add dependencies here while experimenting in a notebook and you
Expand All @@ -78,9 +79,10 @@ test = [
]

docs = [
"sphinx==6.1.3", # Used to automatically generate documentation
"sphinx-rtd-theme==1.2.0", # Used to render documentation
"sphinx-autoapi==2.0.1", # Used to automatically generate api documentation
"sphinx", # Used to automatically generate documentation
"sphinx-rtd-theme", # Used to render documentation
"sphinx-autoapi", # Used to automatically generate api documentation
"sphinx-exec-directive", # running sphinx python commands in documentation
"nbconvert",
"nbsphinx",
"ipython",
Expand Down
4 changes: 2 additions & 2 deletions src/sorcha/ephemeris/simulation_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ def get_residual_vectors(v1):
"""
Decomposes the vector into two unit vectors to facilitate computation of on-sky angles

Parameters:
----------
Parameters
-----------
v1 (array, shape = (3,)):
The vector to be decomposed
Returns:
Expand Down
14 changes: 7 additions & 7 deletions src/sorcha/ephemeris/simulation_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def create_assist_ephemeris(args) -> tuple:
"""Build the ASSIST ephemeris object

Returns
-------
---------
Ephem : ASSIST ephemeris obejct
The ASSIST ephemeris object
gm_sun : float
Expand Down Expand Up @@ -95,8 +95,8 @@ def generate_simulations(ephem, gm_sun, gm_total, orbits_df, args):
"""
Creates the dictionary of ASSIST simulations for the ephemeris generation

Parameters:
-------
Parameters
------------
ephem (Ephem):
The ASSIST ephemeris object
gm_sun (float):
Expand All @@ -108,8 +108,8 @@ def generate_simulations(ephem, gm_sun, gm_total, orbits_df, args):
args (dictionary or `sorchaArguments` object):
dictionary of command-line arguments.

Returns:
-------
Returns
---------
dict
Dictionary of ASSIST simulations

Expand Down Expand Up @@ -168,7 +168,7 @@ def precompute_pointing_information(pointings_df, args, configs):
with additional information that Assist & Rebound needs for it's work.

Parameters
----------
-----------
pointings_df : pandas dataframe
Contains the telescope pointing database.
args : dictionary
Expand All @@ -177,7 +177,7 @@ def precompute_pointing_information(pointings_df, args, configs):
Configuration settings.

Returns
-------
--------
pointings_df : pandas dataframe
The original dataframe with several additional columns of precomputed values.
"""
Expand Down
24 changes: 12 additions & 12 deletions src/sorcha/utilities/retrieve_ephemeris_data_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _decompress(fname, action, pup):
For instance `filename.json.bz` will be decompressed and saved as `filename.json`.

Parameters
----------
------------
fname : string
Original filename
action : string
Expand All @@ -42,7 +42,7 @@ def _remove_files(retriever: pooch.Pooch) -> None:
list.

Parameters
----------
------------
retriever : pooch
Pooch object that maintains the registry of files to download.
"""
Expand All @@ -55,19 +55,19 @@ def _remove_files(retriever: pooch.Pooch) -> None:

def _check_for_existing_files(retriever: pooch.Pooch, file_list: list[str]) -> bool:
"""Will check for existing local files, any file not found will be printed
to the terminal.
to the terminal.

Parameters
----------
retriever : pooch
Pooch object that maintains the registry of files to download.
file_list : list of strings
A list of file names look for in the local cache.
Parameters
-------------
retriever : pooch
Pooch object that maintains the registry of files to download.
file_list : list of strings
A list of file names look for in the local cache.

Returns
-------
Returns
----------
: bool
Returns True if all files are found in the local cache, False otherwise.
Returns True if all files are found in the local cache, False otherwise.
"""

# choosing clarity over brevity with these variables.
Expand Down
4 changes: 2 additions & 2 deletions src/sorcha/utilities/sorcha_demo_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def get_demo_command():

Returns
-----------
None.

: string
working sorcha demo command
"""

return "sorcha -c sorcha_config_demo.ini -p sspp_testset_colours.txt -ob sspp_testset_orbits.des -pd baseline_v2.0_1yr.db -o ./ -t testrun_e2e"
Expand Down
Loading