Skip to content

Commit

Permalink
Merge pull request #1107 from jhmatthews/sirocco
Browse files Browse the repository at this point in the history
Sirocco: rename the code in source code and rename files with python in the filename
  • Loading branch information
jhmatthews authored Oct 21, 2024
2 parents 3207e0a + 39ce287 commit 8469061
Show file tree
Hide file tree
Showing 153 changed files with 641 additions and 641 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*
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Python
# SIROCCO

Python is a (confusingly named) Monte Carlo radiative transfer code which uses the Sobolev approximation. 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.
*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 Python 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)

## Installation

Python 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 Python need to be retrieved and compiled.
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 @@ -26,8 +27,8 @@ If you anticipate contributing to development we suggest forking the repository

Once you have the files, you need to cd to the new directory and set your environment variables

$ export PYTHON = /path/to/python/
$ cd $PYTHON
$ export SIROCCO = /path/to/sirocco/
$ cd $SIROCCO
$ ./configure
$ make install (or better make install 2>&1 | tee today.txt)
$ make clean
Expand All @@ -36,42 +37,41 @@ If you have any difficulties with the installation, please submit an issue, alon

Note that the export syntax is for bash- for csh use

$ setenv PYTHON /path/to/python/
$ setenv SIROCCO /path/to/sirocco/

Atomic data for the current version of Python stored in the directory xdata which is part of the main repository,
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 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 $PYTHON; git clone https://github.com/agnwinds/xmod xmod
$ 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 $PYTHON; git clone https://github.com/agnwinds/data data
$ cd $SIROCCO; git clone https://github.com/agnwinds/data data

Those users interested in the current version of Python should not need to do this)

## Running python
## Running Sirocco

To run python you need to add the following to your $PATH variable:
To run Sirocco you need to add the following to your $PATH variable:

$PYTHON/bin
$SIROCCO/bin

You can then setup your symbolic links by running

$ Setup_Py_Dir

and run the code by typing, e.g.

$ py root.pf
$ 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.
4 changes: 2 additions & 2 deletions bin/Setup_Py_Dir
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@



# please make sure your $PYTHON path is setup to use this script
top=$PYTHON
# please make sure your $SIROCCO path is setup to use this script
top=$SIROCCO
xdata=xdata
xmod=xmod
zdata=zdata
Expand Down
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: jm8g08@soton.ac.uk
# Usage: ./configure
Expand Down
Loading

0 comments on commit 8469061

Please sign in to comment.