Skip to content

Commit

Permalink
Updating Readme, paper and improving installation
Browse files Browse the repository at this point in the history
  • Loading branch information
athob committed Nov 8, 2023
1 parent f447c3b commit c1a87ac
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 17 deletions.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,57 @@ The package was designed to provide easy installation and distribution of the `a

An essential aspect of `ananke` is its integration with the [`EnLink`](https://ui.adsabs.harvard.edu/abs/2009ApJ...703.1061S/abstract)/[`EnBiD`](http://ascl.net/1109.012) C++ software for computing phase space densities. These computed densities are then used as input for the [`Galaxia`](http://ascl.net/1101.007) C++ software, which generates synthetic surveys by incorporating user-supplied GAIA isochrones to produce the mock photometry.

The development of `py-ananke` aims to make this sophisticated framework accessible to a broader community. By providing a self-contained and easily installable Python package, we strive to facilitate the usage and adoption of `ananke` for generating mock star surveys from cosmological simulations, enabling the investigation of stellar halos around nearby galaxies.
The development of `py-ananke` aims to make this sophisticated framework accessible to a broader community. By providing a self-contained and easily installable Python package, we strive to facilitate the usage and adoption of `ananke` for generating mock star surveys from cosmological simulations, enabling the investigation of stellar halos around nearby galaxies.

## Getting started

`py-ananke` is compatible with Python versions above 3.7.12 and below 3.11. The project is organized into three branches: [main](https://github.com/athob/py-ananke/tree/main), [stable](https://github.com/athob/py-ananke/tree/stable), and [develop](https://github.com/athob/py-ananke/tree/develop). The main branch contains the latest released version, while the stable and develop branches host versions currently in development, with stable being the most recent stable version. `py-ananke` uses dedicated wrapper submodules, namely [`py-EnBiD-ananke`](https://github.com/athob/py-EnBiD-ananke) and [`py-Galaxia-ananke`](https://github.com/athob/py-Galaxia-ananke), specifically developed to handle the installation and utilization of the C++ backend software, [`EnBiD`](http://ascl.net/1109.012), and a modified version of [`Galaxia`](http://ascl.net/1101.007) called [`galaxia-ananke`](https://github.com/athob/galaxia-ananke). These submodules relieve users from the need to directly manage the C++ software while isolating the C++ wrapping process. This allows `py-ananke` to focus on processing inputs and outputs using pure Python. It is worth noting that [`galaxia-ananke`](https://github.com/athob/galaxia-ananke) incorporates several pre-installed photometric systems, represented by sets of isochrones generated from the [CMD web interface](http://stev.oapd.inaf.it/cgi-bin/cmd) (commonly referred to as Padova isochrones). Among the available options are HST, GAIA, Euclid, Rubin, JWST & Roman.
`py-ananke` is compatible with Python versions above 3.7.12 and below 3.11. The project is organized into three branches: [main](https://github.com/athob/py-ananke/tree/main), [stable](https://github.com/athob/py-ananke/tree/stable), and [develop](https://github.com/athob/py-ananke/tree/develop). The main branch contains the latest released version, while the stable and develop branches host versions currently in development, with stable being the most recent stable version. `py-ananke` uses dedicated wrapper submodules, namely [`py-EnBiD-ananke`](https://github.com/athob/py-EnBiD-ananke) and [`py-Galaxia-ananke`](https://github.com/athob/py-Galaxia-ananke), specifically developed to handle the installation and utilization of the C++ backend software, [`EnBiD`](http://ascl.net/1109.012), and a modified version of [`Galaxia`](http://ascl.net/1101.007) called [`galaxia-ananke`](https://github.com/athob/galaxia-ananke). These submodules relieve users from the need to directly manage the C++ software while isolating the C++ wrapping process. This allows `py-ananke` to focus on processing inputs and outputs using pure Python. It is worth noting that [`galaxia-ananke`](https://github.com/athob/galaxia-ananke) incorporates several pre-installed photometric systems, represented by sets of isochrones generated from the [CMD web interface](http://stev.oapd.inaf.it/cgi-bin/cmd) (commonly referred to as Padova isochrones). Among the available options are HST, GAIA, Euclid, Rubin, JWST & Roman.

### Installation

To install `py-ananke` , you can use the following pip command, which pulls the latest version directly from the repository's main branch:
To install `py-ananke`, you can use the following pip command, which pulls the latest version directly from the repository's main branch:

pip install git+https://github.com/athob/py-ananke@main

or

python -m pip install git+https://github.com/athob/py-ananke@main

Alternatively, if you prefer, you may clone the repository to your local machine and then install `py-ananke` using the following pip command, which installs it from your local copy of the repository:
Alternatively, if you prefer, you may clone the repository to your local machine and then install `py-ananke` using the following pip command, which installs it from your local copy of the repository:

git clone https://github.com/athob/py-ananke
cd py-ananke
pip install .

Please note that the command with flag `pip install . --no-cache-dir` may be necessary due to some dependencies issues.

***Warning: DO NOT download the repository as a ZIP archive with intention to install it this way, the installation requires the git set up of the repository to propertly install its submodule dependencies.***

After installation, the module can be imported in Python under the name `ananke` and be ran as such.

### Simplified use case

The repository includes a Jupyter notebook that demonstrates a simplified use case utilizing a dummy set of randomly generated particle data. You can access the notebook directly at [jupyter/testing_ananke.ipynb](jupyter/testing_ananke.ipynb). This notebook provides a step-by-step example to help you understand the functionality and usage of `py-ananke` in a straightforward manner.
The repository includes a Jupyter notebook that demonstrates a simplified use case utilizing a dummy set of randomly generated particle data. You can access the notebook directly at [jupyter/testing_ananke.ipynb](jupyter/testing_ananke.ipynb). This notebook provides a step-by-step example to help you understand the functionality and usage of `py-ananke` in a straightforward manner.

## What's under the hood

Work in progress...

## On-going development

`py-ananke` has recently entered its beta phase, and we are diligently working towards its submission to the [Journal of Open Source Software](https://joss.theoj.org).
`py-ananke` has recently entered its beta phase, and we are diligently working towards its submission to the [Journal of Open Source Software](https://joss.theoj.org).

### Upcoming updates

We have an exciting roadmap of upcoming updates planned, which we aim to implement prior to or following the submission. Here are some of the planned updates in no particular order:

- **Improving Extinction**: The extinction feature is currently in an experimental state, and we have identified areas for significant improvement. Firstly, while the user can supply their own extinction coefficients Aλ/A0 for any photometric system, only GAIA currently has default coefficients. Future updates will expand the range of default extinction coefficients for different systems. Secondly, the estimation of dust column density maps per particle currently requires user input. Our plan is to incorporate a treatment that directly computes dust column densities from the simulated metal-enriched gas provided by the user.
- **Implementing Error Modelling**: The original `ananke` framework ([Sanderson et al. 2020](https://ui.adsabs.harvard.edu/abs/2020ApJS..246....6S/abstract)) featured error modelling as a significant component. In future updates, we will introduce a framework that allows for the incorporation of simple error models into the pipeline, enhancing the robustness of the generated mock surveys.
- **Interfacing with Isochrone Databases**: `py-ananke` currently includes pre-loaded isochrones for a chosen photometric system (some of which are listed in the introduction section). Our plan is to implement a direct interface with established isochrone databases such as [Padova](http://stev.oapd.inaf.it/cgi-bin/cmd) or [MIST](https://waps.cfa.harvard.edu/MIST/), enabling users to download available photometric systems on-the-fly. Additionally, we aim to develop a framework that allows `py-ananke` to output photometry in a range of commonly used calibration standards.
- **Additional Modularization**: While [`EnBiD`](http://ascl.net/1109.012) serves as the density estimation routine of choice, we plan to expand the options by adding more choices such as [`EnLink`](https://ui.adsabs.harvard.edu/abs/2009ApJ...703.1061S/abstract). Furthermore, we intend to diversify the selection of kernel functions for density estimation and sampling mock stars in phase space, making it possible to utilize anisotropic kernel functions. Additionally, we will enhance the flexibility of `py-ananke` by incorporating a wider range of initial mass functions (IMFs) and allowing mass sampling based on present mass functions, particularly for generating mock stars in globular clusters.
- **Quality of Life Updates**: We are dedicated to enhancing the user experience and overall usability of `py-ananke` . To that end, we will be implementing various quality of life updates, refining the software interface, improving documentation, and streamlining the overall workflow.
- **Interfacing with Isochrone Databases**: `py-ananke` currently includes pre-loaded isochrones for a chosen photometric system (some of which are listed in the introduction section). Our plan is to implement a direct interface with established isochrone databases such as [Padova](http://stev.oapd.inaf.it/cgi-bin/cmd) or [MIST](https://waps.cfa.harvard.edu/MIST/), enabling users to download available photometric systems on-the-fly. Additionally, we aim to develop a framework that allows `py-ananke` to output photometry in a range of commonly used calibration standards.
- **Additional Modularization**: While [`EnBiD`](http://ascl.net/1109.012) serves as the density estimation routine of choice, we plan to expand the options by adding more choices such as [`EnLink`](https://ui.adsabs.harvard.edu/abs/2009ApJ...703.1061S/abstract). Furthermore, we intend to diversify the selection of kernel functions for density estimation and sampling mock stars in phase space, making it possible to utilize anisotropic kernel functions. Additionally, we will enhance the flexibility of `py-ananke` by incorporating a wider range of initial mass functions (IMFs) and allowing mass sampling based on present mass functions, particularly for generating mock stars in globular clusters.
- **Quality of Life Updates**: We are dedicated to enhancing the user experience and overall usability of `py-ananke`. To that end, we will be implementing various quality of life updates, refining the software interface, improving documentation, and streamlining the overall workflow.

These upcoming updates signify our commitment to continuously improve `py-ananke` and address the evolving needs of the community. We encourage users to stay engaged with the project, provide feedback, and contribute to its development as we work towards a more comprehensive and user-friendly tool for generating mock surveys.
These upcoming updates signify our commitment to continuously improve `py-ananke` and address the evolving needs of the community. We encourage users to stay engaged with the project, provide feedback, and contribute to its development as we work towards a more comprehensive and user-friendly tool for generating mock surveys.

### Contributing

Expand Down
11 changes: 8 additions & 3 deletions paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ authors:
- name: Nicolás Garavito-Camargo
orcid: 0000-0001-7107-1744
affiliation: 6
- name: Sanjib Sharma
orcid: 0000-0002-0920-809X
affiliation: 7
affiliations:
- name: Department of Physics & Astronomy, University of Pennsylvania, 209 S 33rd Street, Philadelphia, PA 19104, USA
index: 1
Expand All @@ -41,6 +44,8 @@ affiliations:
index: 5
- name: Center for Computational Astrophysics, Flatiron Institute, Simons Foundation, 162 Fifth Avenue, New York, NY 10010, USA
index: 6
- name: Space Telescope Science Institute, 3700 San Martin Drive, Baltimore, MD 21218, USA
index: 7
date: 1 October 2023
bibliography: paper.bib

Expand Down Expand Up @@ -107,7 +112,7 @@ The implementation of ``py-ananke`` involves six classes, with only one - ``Anan
The latter two driver classes require respectively extinction coefficients and error models that are photometric-system-dependents and can be specified by the user. Also, ``py-ananke`` is designed with dedicated source files to contain default implementations, which currently only hold default for the Gaia photometric system. Future updates will continue to expand this further.

# Dependencies
\ref{Sec:Dependencies}
\label{Sec:Dependencies}

``py-ananke`` makes use of the following ``Python`` packages:

Expand All @@ -123,7 +128,7 @@ The latter two driver classes require respectively extinction coefficients and e

It also uses adapted versions of the ``C++`` packages:

- ``EnBiD`` [@EnBiD:2006;@EnBiDCode:2011] integrated in ``py-EnBiD``
- ``EnBiD`` [@EnBiD:2006;@EnBiDCode:2011] integrated in ``py-EnBiD-ananke``
- ``Galaxia`` [@Galaxia:2011;@GalaxiaCode:2011] integrated as ``galaxia-ananke`` in ``py-Galaxia-ananke``

Lastly, the ``galaxia-ananke`` ``C++`` submodule uses sets of pre-computed stellar isochrones generated by the Padova database[^1], using:
Expand All @@ -149,7 +154,7 @@ These studies required significant effort caused by the challenges of using ``an

# Author Contributions

As the lead developer on ``py-ananke``, ACRT adapted ``ananke`` by integrating its routines into a self-contained fully installable ``Python`` package, and implemented the new modular and object-oriented infrastructure ``py-ananke`` relies on, including the submodule ``py-EnBiD-ananke`` and ``py-Galaxia-ananke`` submodules, preparing all the associated repository overarching organization. RES, ``ananke``'s original developer, supervised ACRT throughout ``py-ananke``'s development and helped to disseminate early in-development versions of the software to collaborators. APE tested the package for their own projects under the supervision of NGC. FN also tested the package for their projects and implemented fixes to the source code during testing. ACRT, NP and NGC added sets of isochrones to those in the ``galaxia-ananke`` ``C++`` submodule that had previously been assembled by RES.
As the lead developer on ``py-ananke``, ACRT adapted ``ananke`` by integrating its routines into a self-contained fully installable ``Python`` package, and implemented the new modular and object-oriented infrastructure ``py-ananke`` relies on, including the submodule ``py-EnBiD-ananke`` and ``py-Galaxia-ananke`` submodules, preparing all the associated repository overarching organization. RES, ``ananke``'s original developer, supervised ACRT throughout ``py-ananke``'s development and helped to disseminate early in-development versions of the software to collaborators. SS is the original developer of the ``C++`` softwares ``EnBiD`` and ``Galaxia`` which ``ananke`` relies heavily upon. APE tested the package for their own projects under the supervision of NGC. FN also tested the package for their projects and implemented fixes to the source code during testing. ACRT, NP and NGC added sets of isochrones to those in the ``galaxia-ananke`` ``C++`` submodule that had previously been assembled by RES.

# Acknowledgements

Expand Down
9 changes: 7 additions & 2 deletions src/_build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# from packaging import version

from .constants import *
from .__metadata__ import *

__all__ = ['say', 'all_files', 'check_submodules']

Expand Down Expand Up @@ -44,5 +45,9 @@ def all_files(*paths, basedir='.'):
def check_submodules(root_dir):
# if not pathlib.os.listdir(PYENBID) or not pathlib.os.listdir(PYGALAXIA):
say("\nChecking submodules, running git...")
subprocess.call(['git', 'submodule', 'update', '--init', '--recursive'], cwd=root_dir)

try:
_temp = subprocess.call(['git', 'submodule', 'update', '--init', '--recursive'], cwd=root_dir)
except FileNotFoundError:
raise OSError("Your system does not have git installed. Please install git before proceeding")
if _temp == 128:
raise OSError(f"The repository from which you are attempting to install this package is not a git repository.\nPlease follow the online instructions for proper installation ({__url__}/#installation).")
3 changes: 2 additions & 1 deletion src/ananke/__metadata__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Contains the ananke module metadata.
"""
__all__ = ['__author__', '__copyright__', '__credits__', '__license__', '__version__', '__maintainer__', '__email__', '__status__']
__all__ = ['__author__', '__copyright__', '__credits__', '__license__', '__version__', '__maintainer__', '__email__', '__url__', '__status__']

__author__ = "Adrien Thob"
__copyright__ = None
Expand All @@ -11,4 +11,5 @@
__version__ = "0.1.0.dev1"
__maintainer__ = "Adrien Thob"
__email__ = "[email protected]"
__url__ = "https://github.com/athob/py-ananke"
__status__ = "Development Status :: 4 - Beta"

0 comments on commit c1a87ac

Please sign in to comment.