Skip to content

Commit

Permalink
Merge pull request #2 from jhmatthews/docs-patch
Browse files Browse the repository at this point in the history
Docs patch
  • Loading branch information
jhmatthews authored Oct 25, 2024
2 parents 83a6786 + 6dc9928 commit 8c7a560
Show file tree
Hide file tree
Showing 312 changed files with 12,200 additions and 1,701 deletions.
54 changes: 27 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Python: continuous integration tests"
name: "Sirocco: continuous integration tests"
on:
push:
branches:
Expand All @@ -9,69 +9,69 @@ on:
- "dev"
- "main"
env:
PYTHON: ${{ github.workspace }}
SIROCCO: ${{ github.workspace }}
jobs:
greeting:
name: Greeting job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Print out environment variables"
run: |
echo "WORKSPACE IS $GITHUB_WORKSPACE"
echo "PYTHON ENV VARIABLE IS: $PYTHON"
echo "SIROCCO ENV VARIABLE IS: $SIROCCO"
build_and_test:
name: Build Python and run tests
name: Build Sirocco and run tests
runs-on: ubuntu-latest
needs: greeting
steps:
- uses: actions/checkout@v3
#- name: "Installing build dependencies"
# run: sudo apt update && apt install -y build-essential cmake

- name: Configuring Python
- name: Configuring Sirocco
run: ./configure
- name: Build GH Workflow version of Python
- name: Build GH Workflow version of Sirocco
run: make gh_workflow_install

- uses: actions/setup-python@v3
with:
python-version: '3.x' # Version range
- name: Install Python (the language) dependencies
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
cd $PYTHON/examples/gh-workflow/
cd $SIROCCO/examples/gh-workflow/
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Compile programs, again
# run: |
# cd $PYTHON/source
# cd $SIROCCO/source
# make CC=gcc INDENT=no all

- name: Checking Python compiled and can read in inputs correctly
- name: Checking Sirocco compiled and can read in inputs correctly
run: |
cd $PYTHON/examples/gh-workflow/
$PYTHON/bin/Setup_Py_Dir
$PYTHON/bin/py -i cv_macro_benchmark
$PYTHON/bin/py -i cv_standard
$PYTHON/bin/py -i fiducial_agn
$PYTHON/bin/py -i 1d_sn
$PYTHON/bin/py -i -d sv_detailedmode
$PYTHON/bin/py -i agn_ss_2010_modela
$PYTHON/bin/py -i XRB_standard.pf
$PYTHON/bin/py -i ngc5548
$PYTHON/bin/py -i lamp_post
$PYTHON/bin/py -i cv_standard_import
cd $SIROCCO/examples/gh-workflow/
$SIROCCO/bin/Setup_Py_Dir
$SIROCCO/bin/sirocco -i cv_macro_benchmark
$SIROCCO/bin/sirocco -i cv_standard
$SIROCCO/bin/sirocco -i fiducial_agn
$SIROCCO/bin/sirocco -i 1d_sn
$SIROCCO/bin/sirocco -i -d sv_detailedmode
$SIROCCO/bin/sirocco -i agn_ss_2010_modela
$SIROCCO/bin/sirocco -i XRB_standard.pf
$SIROCCO/bin/sirocco -i ngc5548
$SIROCCO/bin/sirocco -i lamp_post
$SIROCCO/bin/sirocco -i cv_standard_import
- name: Running unit tests
run: |
cd $PYTHON/source/tests
cd $SIROCCO/source/tests
make check CC=gcc
- name: Running Balmer test case
run: |
cd $PYTHON/examples/gh-workflow/
$PYTHON/bin/py -f -v 1 balmer_test
python $PYTHON/py_progs/balmer_decrement.py balmer_test
cd $SIROCCO/examples/gh-workflow/
$SIROCCO/bin/sirocco -f -v 1 balmer_test
python $SIROCCO/py_progs/balmer_decrement.py balmer_test
62 changes: 31 additions & 31 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#
# This is the Makefile for the python related programs
# This is the Makefile for the Sirocco related programs
#
# Make sure you have defined $PYTHON as this directory first
# Make sure you have defined $SIROCCO as this directory first
# then type:
#
# ./configure [--with-cuda]
# make install
#
# If this fails, consult https://github.com/agnwinds/python/wiki/Installing-Python
# If this fails, consult documentation
# for manual install.

CMAKE = mpicc
GSL_LOCATION = $(PYTHON)/software/gsl-2.6
CUNIT_LOCATION = $(PYTHON)/software/cunit-3.2.7
GSL_LOCATION = $(SIROCCO)/software/gsl-2.6
CUNIT_LOCATION = $(SIROCCO)/software/cunit-3.2.7
INSTALL_LIBS = True

ifeq (True, $(INSTALL_LIBS))
# GNU Science library -- math routines
MOVE_GSL = \
mkdir $(PYTHON)/include/gsl; \
mv $(GSL_LOCATION)/include/gsl/* $(PYTHON)/include/gsl; \
mv $(GSL_LOCATION)/lib/lib* $(PYTHON)/lib;
mkdir $(SIROCCO)/include/gsl; \
mv $(GSL_LOCATION)/include/gsl/* $(SIROCCO)/include/gsl; \
mv $(GSL_LOCATION)/lib/lib* $(SIROCCO)/lib;
INSTALL_GSL = \
cd $(GSL_LOCATION); \
./configure --disable-shared --prefix=$(GSL_LOCATION) cc=gcc CPP=cpp; \
Expand All @@ -40,19 +40,19 @@ ifeq (True, $(INSTALL_LIBS))
# CUnit -- unit test framework: built using CMake, so only build if installed
ifneq ($(shell which cmake), )
INSTALL_CUNIT = \
mkdir -p $(PYTHON)/include/CUnit; \
mkdir -p $(SIROCCO)/include/CUnit; \
cd $(CUNIT_LOCATION); \
mkdir -p build; \
cd build; \
cmake ..; \
cmake --build .; \
mv CUnit/libcunit.a $(PYTHON)/lib; \
cp ../CUnit/CUnit/*.h $(PYTHON)/include/CUnit/; \
mv CUnit/libcunit.a $(SIROCCO)/lib; \
cp ../CUnit/CUnit/*.h $(SIROCCO)/include/CUnit/; \
cd ..; \
rm -rf build;

MAKE_CHECK = \
cd $(PYTHON)/source; \
cd $(SIROCCO)/source; \
make check CC=$(CMAKE)
else
INSTALL_CUNIT = echo 'Unable to install CUnit as CMake (https://cmake.org) is not installed'
Expand All @@ -65,14 +65,14 @@ else
MAKE_CHECK =
endif

MAKE_PYTHON = \
cd $(PYTHON)/source; \
MAKE_SIROCCO = \
cd $(SIROCCO)/source; \
make CC=$(CMAKE) INDENT=no all \

# Compile and install the libraries and Python
# Compile and install the libraries and Sirocco
install:
@echo 'Installing Python. the radiative transfer code'
@echo 'Installing in directory '$(PYTHON)
@echo 'Installing Sirocco. the radiative transfer code'
@echo 'Installing in directory '$(SIROCCO)

# Then make GSL library
@echo 'Installing GSL library...'
Expand All @@ -84,13 +84,13 @@ install:

# Finally, make the latest release
@echo 'Making source code...'
$(MAKE_PYTHON)
$(MAKE_SIROCCO)
@echo 'all done'

# Install Python for travis -- as above, minus post-installation checks for GSL
# Install Sirocco for travis -- as above, minus post-installation checks for GSL
gh_workflow_install:
@echo 'Installing Python. the radiative transfer code'
@echo 'Installing in directory '$(PYTHON)
@echo 'Installing Sirocco. the radiative transfer code'
@echo 'Installing in directory '$(SIROCCO)

# Then make GSL library
@echo 'Installing GSL library...'
Expand All @@ -102,12 +102,12 @@ gh_workflow_install:

#finally, make the latest release
@echo 'Making source code...'
$(MAKE_PYTHON)
$(MAKE_SIROCCO)
@echo 'all done'

# Runs Python's unit tests
# Runs Sirocco's unit tests
check:
cd $(PYTHON)/source; make check
cd $(SIROCCO)/source; make check

# Runs through the install for GSL and post-installation checks
gsl:
Expand All @@ -119,24 +119,24 @@ cunit:
@echo 'Installing CUnit unit test framework'
$(INSTALL_CUNIT)

# Run the regular clean for the libraries and Python. CUnit doesn't need this,
# Run the regular clean for the libraries and Sirocco. CUnit doesn't need this,
# as we delete the CMake build directory after installing it
clean:
rm -f *.o *~
cd $(GSL_LOCATION); make clean;
rm -rf $(CUNIT_LOCATION)/build
cd $(PYTHON)/source/; make clean
cd $(SIROCCO)/source/; make clean

# Runs a more rigorous clean for the libraries and Python. CUnit doesn't need
# Runs a more rigorous clean for the libraries and Sirocco. CUnit doesn't need
# this, as we delete the CMake build directory after installing it
distclean:
rm -f *.o *~
cd $(GSL_LOCATION); make distclean
rm -rf $(CUNIT_LOCATION)/build
cd $(PYTHON)/source/; make clean
cd $(SIROCCO)/source/; make clean

# Remove just the libraries
rm_lib:
rm -rf $(PYTHON)/include/gsl
rm -rf $(PYTHON)/include/CUnit
rm -f $(PYTHON)/lib/lib*
rm -rf $(SIROCCO)/include/gsl
rm -rf $(SIROCCO)/include/CUnit
rm -f $(SIROCCO)/lib/lib*
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@

*Sirocco* (Simulating Ionization and Radiation in Outflows Created by Compact Objects) is a Monte Carlo radiative transfer code which uses the Sobolev approximation. The code was formerly known as Python and renamed in October 2024. It has been developed by Knox Long, Christian Knigge, Stuart Sim, Nick Higginbottom, James Matthews, Sam Manghamm Edward Parkinson, Mandy Hewitt and Nico Scepi. The code has been used for a variety of research projects invovling the winds of cataclysmic variables, young stellar objects, X-ray binaries and AGN.

The code is under active development, but we are looking for beta users to test the code, and potentially use it for their own research. If you are interested in using Sirocco please contact Knox Long via long[at]stsci[dot]edu.
The code is under active development, but we are looking for beta users to test the code, and potentially use it for their own research. If you are interested in using Sirocco please contact Knox Long via long[at]stsci[dot]edu
or James Matthews via james[dot]matthews[at]physics[dot]ox[dot]ac[dot]uk.

Documentation is hosted on [ReadTheDocs](http://agnwinds.readthedocs.io/en/dev/).
Documentation is hosted on [ReadTheDocs](http://sirocco-rt.readthedocs.io/en/dev/).

## CI \& Docs Build Status

[![C/C++ CI](https://github.com/agnwinds/python/actions/workflows/build.yml/badge.svg)](https://github.com/agnwinds/python/actions/workflows/build.yml)
[![C/C++ CI](https://github.com/sirocco-rt/sirocco/actions/workflows/build.yml/badge.svg)](https://github.com/sirocco-rt/sirocco/actions/workflows/build.yml)

[![Documentation Status](https://readthedocs.org/projects/agnwinds/badge/?version=latest)](https://agnwinds.readthedocs.io/en/latest/?badge=latest)
[![Documentation Status](https://readthedocs.org/projects/sirocco-rt/badge/?version=latest)](https://sirocco-rt.readthedocs.io/en/latest/?badge=latest)

## Installation

Sirocco and the various routines associated are set up in a self-contained directory structure. The basic directory structure and the data files that one needs to run Sirocco need to be retrieved and compiled.

If you want to obtain a stable (!) release, go to the [Releases](https://github.com/agnwinds/python/releases) page.
If you want to obtain a stable (!) release, go to the [Releases](https://github.com/sirocco-rt/sirocco/releases) page.

If you want to download the latest dev version, you can zip up the git repository by clicking on the zip icon to the right of the GitHub page. Aternatively, you can clone the repository using

Expand All @@ -41,15 +42,15 @@ Note that the export syntax is for bash- for csh use
Atomic data for the current version of Sirocco stored in the directory xdata which is part of the main repository,

However, if one wishes to use model stellar spectra to simulate the spectra of the star or disk, one my wish to
also to download various model grids of spectra that have been used in conjunction with Sirocco/Python over the years. These are in a separate [models repository]((https://github.com/agnwinds/xmod).
also to download various model grids of spectra that have been used in conjunction with Sirocco/Python over the years. These are in a separate [models repository]((https://github.com/sirocco-rt/xmod).

These can be downloaded as follows:

$ cd $SIROCCO; git clone https://github.com/agnwinds/xmod xmod

(Previously, both the atomic data and the model grids were stored in a separate repository. Users wishing
to run older versions of the code pre-84b may need to download the
[old data repository](https://github.com/agnwinds/data) This repository can be downloaded as follows
[old data repository](https://github.com/sirocco-rt/data) This repository can be downloaded as follows


$ cd $SIROCCO; git clone https://github.com/agnwinds/data data
Expand All @@ -71,6 +72,6 @@ and run the code by typing, e.g.
$ sirocco root.pf


Please see the [ReadTheDocs](http://agnwinds.readthedocs.io/en/dev/) or the docs folder for how to use the code. You will need sphinx installed to build the documentation yourself.
Please see the [ReadTheDocs](http://sirocco-rt.readthedocs.io/en/dev/) or the docs folder for how to use the code. You will need sphinx installed to build the documentation yourself.

Any comments, email one of the addresses above.
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# Shell script for configuring Python radiative transfer code compilation
# Shell script for configuring Sirocco radiative transfer code compilation
# James Matthews, University of Southampton
# Questions: [email protected]
# Usage: ./configure
Expand Down
2 changes: 2 additions & 0 deletions docs/pydocs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ This directory contains help files created from doc strings from
python scripts in the py_progs directory.

To create the documentation yourself, simply run `write_docs.py`.

This procedure should be largely superseded by https://agnwinds.readthedocs.io/en/dev/py_progs.html but that page is not currently complete.
4 changes: 2 additions & 2 deletions docs/sphinx/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ numpy
matplotlib
scipy
sqlalchemy
jinja2==3.0.3
jinja2==3.1.4
sphinx_gallery
pyhdf
sphinx-autoapi==3.1.1
sphinx-autoapi==3.1.1
16 changes: 8 additions & 8 deletions docs/sphinx/source/atomic.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
Atomic Data
###########

Any Python model is only as good as the atomic data which goes into making the model.
All of the atomic data that Python accepts is read in by the routine get_atomicdata,
Any SIROCCO model is only as good as the atomic data which goes into making the model.
All of the atomic data that SIROCCO accepts is read in by the routine get_atomicdata,
and all of the data is read in from a series of ascii data files and stored in structures
that are defined in atomic.h.


The purpose of documentation is as follows:

* to explain the atomic data formats used by Python and the relationship of different sets
* to explain the atomic data formats used by SIROCCO and the relationship of different sets
of data to one another

* to explain where the data currently used in Python and to explain how the raw data
is translated in to a format the Python accepts
* to explain where the data currently used in SIROCCO and to explain how the raw data
is translated in to a format the SIROCCO accepts

The routines used to translate raw data format for two-level atoms (as well as much of the raw data)
are contained in a separate github `repository <https://github.com/agnwinds/data-gen>`_
Expand All @@ -25,15 +25,15 @@ The routines used to generate data for MacroAtoms are described in :doc:`Generat

Choosing a dataset
-----------------------
The "masterfile" that determines what data will be read into Python is determined by the
The "masterfile" that determines what data will be read into SIROCCO is determined by the
line in the parameter file, which will read something like::

Atomic_data data/standard80.dat
where the file `data/standard80.dat` will contain names (one to a line) of files which will
be read in sequentially.

All of the atomic data that comes as standard with Python is stored in the `xdata` directory (and its subdirectories) but users are not required to put their data
All of the atomic data that comes as standard with SIROCCO is stored in the `xdata` directory (and its subdirectories) but users are not required to put their data
there. Various experimental or testing dataset masterfiles are stored in the `zdata` directory. Symbolic links to these directories
are setup by running `Setup_Py_Dir`.

Expand All @@ -44,7 +44,7 @@ are setup by running `Setup_Py_Dir`.
Data hierarchy and I/O
-----------------------
As mentioned above, the masterfile will contain names (one to a line) of files which will
be read in sequentially. Every line in the atomic data files read by Python consists of a keyword that defines the type
be read in sequentially. Every line in the atomic data files read by SIROCCO consists of a keyword that defines the type
of data and various data values that are required for that particular data type. Lines that
beging with # or are empty are ignored.

Expand Down
Loading

0 comments on commit 8c7a560

Please sign in to comment.