Skip to content

Commit afde67d

Browse files
committed
Conflicts resolved
2 parents 6620502 + e06cb3b commit afde67d

File tree

15 files changed

+18381
-34
lines changed

15 files changed

+18381
-34
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,10 @@ COMPAS
3535
*.synctex.gz
3636
*.synctex.gz(busy)
3737

38+
# docs html
39+
*_build
40+
41+
*.vscode
42+
3843
Makefile-reinhold
3944
.gitignore

docs/online-docs/README.md

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,99 @@
1-
# COMPAS-docs
1+
COMPAS online documentation
2+
===========================
3+
4+
The COMPAS online documentation is available at this URL:
5+
6+
https://compas.science/docs
7+
8+
which redirects to the underlying readthedocs page at:
9+
10+
https://compas.readthedocs.io/en/latest/index.html
11+
12+
13+
The source files for the online documentation are in the 'docs' directory at:
14+
15+
https://github.com/TeamCOMPAS/COMPAS
16+
17+
18+
The online documentation is provided via readthedocs. To learn more about readthedocs, visit:
19+
20+
https://readthedocs.org/
21+
22+
23+
readthedocs uses the Sphinx document generator. To learn more about Sphinx, visit:
24+
25+
https://www.sphinx-doc.org/en/master/index.html
26+
27+
28+
The file 'requirements.txt', in the 'docs' directory, lists the software/python modules required
29+
to build the documentation. If you plan to build the documentation locally (either so you can
30+
test your changes before you push them to the repository, or just to view the documentation locally
31+
rather than online), you will need to install these requirements.
32+
33+
The requirements.txt file informs readthedocs what dependencies need to be installed in order for
34+
readthedocs to build the online documentation. Some modules are commented ('#') in requirements.txt
35+
because readthedocs either doesn't require them, or installs them by default - you will need to install
36+
the commented modules to build the documentation locally.
37+
38+
Python is required, so install that if it is not already installed. Then install 'sphinx', and the
39+
modules listed in requirements.txt (including the ones commented).
40+
41+
42+
Updating the documentation
43+
--------------------------
44+
45+
The documentation source file are ReST (Restructured text) files - similar to markdown. With readthedocs,
46+
eash .rst file is compiled into a .html file, so viewable with a web browser. The documentation source
47+
files (the .rst files) are in 'docs/online-docs' (only the 'requirements.txt' file is required by
48+
readthedocs to be in the 'docs' directory - if that file is not in the 'docs' directory, or top-level
49+
directory of the repo, readthedocs will not build the online documentation).
50+
51+
The 'online-docs' directory contains files and sub-directories that are structured to match the structured
52+
of the online documentation. Find the .rst file you want to modify, and make the changes in your favourite
53+
text editor. If you need to add new .rst files, follow the existing structure, and make sure you link the
54+
files into an index (toctree) somewhere.
55+
56+
57+
Building the documentation locally
58+
----------------------------------
59+
60+
Once you have Sphinx and the dependencies (from 'requirements.txt') installed, navigate to the 'docs/online-docs'
61+
directory in you local COMPAS repo, and type:
62+
63+
make clean
64+
make html
65+
66+
If everything has been installed correctly this will first remove the existing .html files for the documentation
67+
(make clean), and then recreate them (make html). During the build process you may see some warnings that some
68+
documents (.rst files) are not included in any toctree - that's ok, not all our pages are accessible via a table
69+
of contents (toctree).
70+
71+
If the build completes successfully, there will be .html files in the 'docs/online-docs/\_build/html' directory.
72+
To view the newly build documentation, open 'docs/online-docs/\_build/html/index.html' with your web browser
73+
(e.g. type 'file://path-to-compas/docs/online-docs/\_build/html/index.html' into your web browser address bar,
74+
where 'path-to-compas' is the path to your local COMPAS repo).
75+
76+
Aside: the '\_build' directory is not required on the remote repo (and will only bloat the repo), so you should
77+
add it to your .gitignore.
78+
79+
80+
Pushing the changes online
81+
--------------------------
82+
83+
Once you are satisfied with your changes, push the updated source files to the COMPAS repo as you would any source
84+
changes. If things work properly, that's all you need to do: readthedocs has webhooks that will notice the change
85+
and automatically rebuild the online documentation. The process (noticing the change, rebuilding the documentation,
86+
then deploying the updated web pages) could take up to 15 minutes or so. If something goes wrong and the changes are
87+
not noticed by readthedocs, or you just don't want to wait 15 minutes for your changes to appear on the web, you can
88+
log into the readthedocs project and initiate a rebuild manually.
89+
90+
The COMPAS readthedocs project name is 'compas', and the project page is:
91+
92+
https://readthedocs.org/projects/compas/
93+
94+
You need to login to the readthedocs project to do anything other than look at the dashboard. Once you are logged in
95+
you can rebuild the project. To manually start the rebuild, make sure you are on the 'Overview' page (select the
96+
'Overview' button if you are not) and select the 'Build' button. The build may sometimes fail with an "environment"
97+
error - the solution is to wait a few minutes and try again (readthedocs has some concurrency and timing limits).
98+
Logon details can be found on the COMPAS slack workspace (devel\_compas\_documentation channel).
99+
0 Bytes
Binary file not shown.

docs/online-docs/pages/User guide/Tutorial/example-compas-run.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
Tutorial: simple COMPAS run
22
===========================
33

4+
This tutorial assumes that you have already built the COMPAS executable as described in :doc:`../../Getting started/building-COMPAS`.
5+
46
For this example you will need the python script ``pythonSubmitDemo.py``, which specifies all the program options (physics assumptions,
57
output types) and runs COMPAS in the terminal. Although the primary functionality of COMPAS is to evolve a whole population of binary
68
stars rapidly, for now, let's focus on evolving a single stellar system and examining the detailed output.
79

8-
To start, change to the ``examples/methods_paper_plots/detailed_evolution/`` directory::
10+
If you haven't yet defined the ``COMPAS_ROOT_DIR`` environment variable, do that now::
911

10-
cd $COMPAS_ROOT_DIR/examples/methods_paper_plots/detailed_evolution/
12+
export COMPAS_ROOT_DIR=path-to-compas
1113

12-
where you will find the script ``pythonSubmitDemo.py`` for this demo.
14+
where `path-to-compas` should be replaced with the path to the parent directory of the COMPAS `src` directory. Depending upon your system,
15+
for the ``export`` command to take effect, it may be necessary to either restart your session or execute the following command::
1316

14-
If you haven't yet defined the ``COMPAS_ROOT_DIR`` environment variable, do that now::
17+
source ~/.bashrc
1518

16-
export COMPAS_ROOT_DIR=~/path-to-compas/COMPAS
19+
To start, change to the ``examples/methods_paper_plots/detailed_evolution/`` directory::
1720

18-
where `path-to-compas` should be replaced with the path to the parent directory of the directory in which the COMPAS executable resides.
19-
Depending upon your system, for the ``export`` command to take effect, it may be necessary to either restart your session or execute the
20-
following command::
21+
cd $COMPAS_ROOT_DIR/examples/methods_paper_plots/detailed_evolution/
2122

22-
source ~/.bashrc
23+
where you will find the script ``pythonSubmitDemo.py`` for this demo.
2324

2425

2526
.. toctree::

examples/methods_paper_plots/detailed_evolution/detailed_evol_plotter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ def printEvolutionaryHistory(Data):
149149
MTstring='CE: both MS'
150150
elif Data['MT_History'][i]==7:
151151
MTstring='CE: MS with CO'
152+
elif Data['MT_History'][i]==8:
153+
MTstring='CE merger, rad env'
154+
elif Data['MT_History'][i]==9:
155+
MTstring='CE merger, >RLOF'
152156
else:
153157
MTstring='Unknown MT'
154158

-84.5 KB
Binary file not shown.

joss-logo.png

96 KB
Loading

0 commit comments

Comments
 (0)