You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Pull requests are welcome. If you want to contribute code to solve an open issue
19
19
* Create a topic branch based on main.
20
20
* Commit there your code to solve the issue.
21
21
* Make sure all test are passing (and add specs to test any new feature if needed).
22
-
* Follow the code styles and practices already in place.
22
+
* Follow the code styles and practices already in place. Starmatrix follows [PEP8](https://peps.python.org/pep-0008/).
23
23
* Open a *pull request* to the main repository mentioning the issue you are addressing.
24
24
25
25
## Cleaning up
@@ -47,6 +47,10 @@ In the rush of time sometimes things get messy, you can help us cleaning things
47
47
* Actual response
48
48
* Sometimes it is also helpful if you mention your operating system or shell.
49
49
50
+
## License
51
+
52
+
Starmatrix is released under the [MIT license](https://github.com/xuanxu/starmatrix/blob/main/LICENSE).
53
+
50
54
## Code of Conduct
51
55
52
56
Obviously there is very little chance of having fun or creating anything interesting in an environment where people do not feel safe. That's why `starmatrix` has a [Code of Conduct](CODE_OF_CONDUCT.md) every contributor must comply. Please read it if you plan to be part of the `starmatrix` community.
Copy file name to clipboardExpand all lines: README.rst
+35-18Lines changed: 35 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,8 @@ Starmatrix computes the contribution matrix of 15 elements:
33
33
H D He3 He4 C C13 N O n.r. Ne Mg Si S Ca Fe
34
34
= = === === = === = = ==== == == == = == ==
35
35
36
+
Starmatrix is a tool for astronomers working with galactic chemical evolution models needing detailed datasets to use as input, wanting to compare the validity of different yield sets or assessing different nucleosynthesis modeling assumptions.
37
+
36
38
Installation
37
39
============
38
40
@@ -46,6 +48,17 @@ A previous installation can be upgraded to the latest version with::
46
48
47
49
$ pip install --upgrade starmatrix
48
50
51
+
Edge
52
+
----
53
+
54
+
If you want to play with the latest code present in this repository even if it has not been released yet, you can do it by cloning the repo locally and instructing pip to install it::
@@ -56,6 +69,18 @@ To test installation worked you can just run Starmatrix with default values runn
56
69
57
70
The first command will generate a basic configuration file (named ``config-example.yml``) and the second command will run Starmatrix using that configuration. A folder named ``results``should be created with the output files.
58
71
72
+
Test suite
73
+
==========
74
+
75
+
Starmatrix includes a test suite located in the ``/src/starmatrix/tests`` directory. The current state of the build is `publicly tracked by GitHub CI`_. You can run the latest tests locally and get information on code coverage if you clone the code to your local machine, install its development dependencies and use ``pytest``::
@@ -97,7 +126,7 @@ If you want to use an existent configuration file as template for your own, you
97
126
98
127
$ starmatrix --generate-config
99
128
100
-
That command will create a ``config-example.yml`` file in the current dir.
129
+
That command will create a ``config-example.yml`` file in the current dir containing the default values.
101
130
102
131
103
132
Initial mass function
@@ -177,26 +206,14 @@ The ``sn_yields`` param in the config file can be set to use any of the availabl
177
206
:mor2018-1: Data from Mori, K. et al., 2018, ApJ, 863:176 W7
178
207
:mor2018-2: Data from Mori, K. et al., 2018, ApJ, 863:176 WDD2
179
208
180
-
Test suite
181
-
==========
182
-
183
-
Starmatrix includes a test suite located in the ``/src/starmatrix/tests`` directory. The current state of the build is `publicly tracked by GitHub CI`_. You can run the latest tests locally and get information on code coverage if you clone the code to your local machine, install its development dependencies and use ``pytest``::
.. _`publicly tracked by GitHub CI`: https://github.com/xuanxu/starmatrix/actions/workflows/tests.yml
209
+
Contributions
210
+
=============
191
211
192
-
Edge
193
-
====
212
+
If you find a bug or have a question, please [open an issue in the project's repo](https://github.com/xuanxu/starmatrix/issues).
194
213
195
-
If you want to play with the latest code present in this repository even if it has not been released yet, you can do it by cloning the repo locally and instructing pip to install it::
214
+
Contributions are welcome, please read our `contributing guidelines`_.
Copy file name to clipboardExpand all lines: docs/usage.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ This is the list of all Starmatrix modules::
38
38
39
39
**Examples:**
40
40
41
-
Run a model with your own custom parameters from inside your programs::
41
+
Run a model with your own custom parameters (in this example custom_params is a dict object modifying any of the available :doc:`configuration parameters <configuration>`) from inside your programs::
Copy file name to clipboardExpand all lines: paper/paper.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,17 +23,17 @@ bibliography: paper.bib
23
23
24
24
`Starmatrix` is a Python package for computing the chemical contribution to the interstellar medium ejected by simple stellar populations (SSPs).
25
25
26
-
One of the key ingredients of galactic chemical evolution models is the nucleosynthetic contribution returned to the interstellar medium by the evolving stellar populations and supernovae. This yields varies depending on the age and metallicity of the stars and are combined following the mass distribution of stars to represent a simple stellar population. Repeating this process adjusting for the the star formation at each time step is one of the main mechanisms of GCE models.
26
+
One of the key ingredients of galactic chemical evolution (GCE) models is the nucleosynthetic contribution returned to the interstellar medium by the evolving stellar populations and supernovae. This yields vary depending on the age and metallicity of the stars and are combined following the mass distribution of stars to represent a simple stellar population. Repeating this process adjusting for the the star formation at each time step is one of the main mechanisms of GCE models.
27
27
28
-
`Starmatrix` reads a single configuration file and calculates the combined contributions of chemical elements ejected to the interstellar medium during the lifetime of stars in the provided mass range. For each mass step an ejections matrix is computed for these fifteen elements: $H$, $D$, $^{3}He$, $^{4}He$, $^{12}C$, $^{16}O$, $^{14}N$, $^{13}C$, $^{20}Ne$, $^{24}Mg$, $^{28}Si$, $^{32}S$, $^{40}Ca$, $^{56}Fe$, and neutron-rich elements as only one group.
28
+
`Starmatrix` reads a single configuration file and calculates the combined contributions of chemical elements ejected to the interstellar medium during the lifetime of stars in the provided mass range. For each mass step an ejections matrix is computed for these fifteen elements: $H$, $D$, $^{3}He$, $^{4}He$, $^{12}C$, $^{16}O$, $^{14}N$, $^{13}C$, $^{20}Ne$, $^{24}Mg$, $^{28}Si$, $^{32}S$, $^{40}Ca$, $^{56}Fe$, and also all neutron-rich CNO isotopes as only one group.
29
29
30
-
Using explicit (and configurable) values for *solar abundances*, *metallicity (z)*, *ejection rates* and *Initial Mass Function (IMF)*, `Starmatrix` calculates matrices $Q_{ij}$ of masses of elements `i` ejected to the galactic medium as element `j`, integrating for a given range of stellar masses, and accounting for Supernovae (SNe) of types *I* and *II*. Based on the *Matrices Q formalism*[@ferrini1992;@portinari1998], an output file is generated containing matrices linking any ejected species to all its different nucleosynthetic sources.
30
+
Using explicit (and configurable) values for *solar abundances*, *metallicity (z)*, *ejection rates* and *Initial Mass Function (IMF)*, `Starmatrix` calculates matrices $Q_{ij}$ of masses of elements `j` ejected to the galactic medium as element `i`, integrating for a given range of stellar masses, and accounting for Supernovae (SNe) of types *I* and *II*. Based on the *Matrices Q formalism*[@ferrini1992;@portinari1998], an output file is generated containing matrices linking any ejected species to all its different nucleosynthetic sources.
31
31
32
32
# Statement of need
33
33
34
34
Calculating the contributions of chemical elements from different stars in several mass ranges is a necessary step for galactic chemical evolution models [@molla2017]. Usually this is done internally and the chemical yields are convoluted with a star formation history (SFH) inside the model, making it difficult to find reusable opensourced code for calculating the yield for a simple stellar population. The central module in Chempy [@rybizki2017] and the SYGMA module from the NUPYCEE framework [@sygma2018] are exceptions, but being part of bigger codebases they are not available as standalone libraries, not listed in the official Python Package Index and learning how to install and use them is not simple.
35
35
36
-
`Starmatrix` isolates the SSP yield calculation step as a open source permissively licensed Python implementation, in a modular an flexible way that can be used to provide detailed datasets to be used as input for galactic chemical evolution models, to compare the validity of different yield sets from the literature or to assess different nucleosynthesis modeling assumptions [@bazan2003].
36
+
`Starmatrix` isolates the SSP yield calculation step as an open source permissively licensed Python implementation, in a modular an flexible way that can be used to provide detailed datasets to be used as input for galactic chemical evolution models, to compare the validity of different yield sets from the literature or to assess different nucleosynthesis modeling assumptions [@bazan2003].
37
37
38
38
# Features
39
39
@@ -42,7 +42,7 @@ Then, the time step is converted back into stellar mass intervals and a $Q$ matr
42
42
43
43
All quantities in the $Q$ matrix are calculated on the base of the ejected mass from stars, using for it the dataset of yields per stellar mass that is entered as input for the code. The code is prepared to include any sets of stellar yields from the literature but if none is declared a default dataset for solar metallicity and with low and intermediate mass star yields from [@gavilan2006] and yields of massive stars from [@chieffi2004] will be used.
44
44
45
-

45
+

46
46
47
47
Configurable parameters include metallicity, mass range for $Q$ matrices, fraction of binary systems, lower and upper mass limits for the IMF, total time steps for integration and yield correction factors. The code also includes a variety of options for `IMFs`, `solar abundances` data, Supernovae `yields` and `Delay Time Distributions` from the literature to choose from. A complete list of available options can be found in the documentation. To make the code more reusable and to allow it to be integrated in or called by other codebases, Starmatrix defines a base class for each of these parameters to be subclassed if needed so custom options can be easily added programmatically. The code also includes extensive test coverage.
0 commit comments