From c1a87ac9e3d127716256a6974d45c6f83fe36794 Mon Sep 17 00:00:00 2001 From: Adrien Thob Date: Wed, 8 Nov 2023 11:49:29 -0500 Subject: [PATCH] Updating Readme, paper and improving installation --- README.md | 24 ++++++++++++++---------- paper.md | 11 ++++++++--- py-Galaxia-ananke | 2 +- src/_build_utils.py | 9 +++++++-- src/ananke/__metadata__.py | 3 ++- 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 2ed0e8e..5ed1188 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,15 @@ 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 @@ -27,7 +27,7 @@ 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 @@ -35,9 +35,13 @@ Alternatively, if you prefer, you may clone the repository to your local machine 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 @@ -45,7 +49,7 @@ 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 @@ -53,11 +57,11 @@ We have an exciting roadmap of upcoming updates planned, which we aim to impleme - **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 diff --git a/paper.md b/paper.md index 7604a78..487ca27 100644 --- a/paper.md +++ b/paper.md @@ -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 @@ -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 @@ -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: @@ -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: @@ -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 diff --git a/py-Galaxia-ananke b/py-Galaxia-ananke index ea69f41..5878899 160000 --- a/py-Galaxia-ananke +++ b/py-Galaxia-ananke @@ -1 +1 @@ -Subproject commit ea69f41ebf90cc14c2c7eeffd320775829887c07 +Subproject commit 58788994ae2e79b159d2d7209590b363369b0cef diff --git a/src/_build_utils.py b/src/_build_utils.py index f0e2da1..f5be3fe 100644 --- a/src/_build_utils.py +++ b/src/_build_utils.py @@ -9,6 +9,7 @@ # from packaging import version from .constants import * +from .__metadata__ import * __all__ = ['say', 'all_files', 'check_submodules'] @@ -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).") diff --git a/src/ananke/__metadata__.py b/src/ananke/__metadata__.py index 0a29691..7a5eed8 100644 --- a/src/ananke/__metadata__.py +++ b/src/ananke/__metadata__.py @@ -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 @@ -11,4 +11,5 @@ __version__ = "0.1.0.dev1" __maintainer__ = "Adrien Thob" __email__ = "athob@sas.upenn.edu" +__url__ = "https://github.com/athob/py-ananke" __status__ = "Development Status :: 4 - Beta"