Skip to content

Commit

Permalink
Merge pull request #13 from hep-mh/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
hep-mh authored Sep 23, 2024
2 parents 3486627 + 99716ab commit 157a0a1
Show file tree
Hide file tree
Showing 60 changed files with 1,510 additions and 1,596 deletions.
34 changes: 19 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
# Files from personal projects
acropolis/prj/*
acropolis/data/cn.dat

# Reference paper
paper*
/paper*

# AlterBBN files
alterbbn*
/alterbbn/*

# Temporary files
CHANGES
TODO
manual/v*
plots/v*

# Project files
/prj/*
/acropolis/prj

# Files for later versions
/acropolis/v*

# Backup files
/acropolis/backup

# Testing scripts
test.py
/test.py
/test.ipynb

# Plots
plots/data/*
# Plot data
/plots/data/*

# Build files
build/*
dist/*
ACROPOLIS.egg-info
/build/*
/dist/*
/ACROPOLIS.egg-info

# Byte-compiled / optimized / DLL files
__pycache__
Expand All @@ -35,7 +40,6 @@ __pycache__
*.sty
*.bst
*.bib
manual/plots/*

*.bbl
*.log
Expand Down
34 changes: 26 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

![arXiv: 2011.06518](https://img.shields.io/badge/arXiv-2011.06518-red.svg?style=flat-square)
![Language: Python3](https://img.shields.io/badge/Language-Python3-blue.svg?style=flat-square)
![Version: 1.2.2](https://img.shields.io/badge/Current_Version-1.2.2-green.svg?style=flat-square)
![DevVersion: 1.3](https://img.shields.io/badge/Current_Dev_Version-1.3-orange.svg?style=flat-square)
![Version: 1.3.0](https://img.shields.io/badge/Current_Version-1.3.0-green.svg?style=flat-square)
![DevVersion: 2.0.0](https://img.shields.io/badge/Current_Dev_Version-2.0.0-orange.svg?style=flat-square)

<img src="https://acropolis.hepforge.org/ACROPOLIS.png" alt="logo" width="600"/><br />
When using this code for your own scientific publications, please cite
Expand All @@ -29,51 +29,69 @@ The remarkable agreement between observations of the primordial light element ab
# Changelog

<details open>
<summary>v1.2.2 (April 6, 2022)</summary>
<summary>v1.3.0 (September 17, 2024)</summary>

- Implemented the model ``acropolis.ext.models.ResonanceModel``, which can be used to calculate PDI constraints for models with resonantly-enhanced DM annihilations
- Updated the initial abundances, which have now be calculated with ``PArthENoPE v3.0`` and hence include the updated deuterium reaction rates
- Added PDG2021 and PDG2022 values to ``acropolis.obs``
- Implemented the new package ``acropolis.jit`` to fixed warnings caused by new versions of ``numba``
- Removed the requirement for the data in ``cosmo_file.dat`` to be equidistant in log space
- Improved the progress indicator when running parameter scans without a ``fast`` parameter
- Unified the plotting script in ``plots/plot_scan_results.py`` by using the methods defined in ``acropolis.plots``
- Added additional plotting functionality in ``acropolis.plots`` (extracting contours, specifying the ``x`` and ``y`` data for the plot, ...)

</details><br />

<details>
<summary>v1.2.2 (April 6, 2022)</summary>

- Implemented fixes for the issues #10 and #11 on GitHub
- Made some initial plotting functions available in ``acropolis.plots``, which can be used to easily plot the results of parameter scans
- Improved the output that is printed to the screen (especially for parameter scans if ``verbose=True``)
- Updated the neutron lifetime to the PDG 2020 recommended value
- Included some example files, e.g. for parameter scans, in the directory examples/
- Included a new c-file tools/create_sm_abundance_file.c, which can be used with [``AlterBBN``](https://alterbbn.hepforge.org/) to generate the file ``abundance_file.dat`` for sm.tar.gz
- Included a new c-file ./tools/create_sm_abundance_file.c, which can be used with [``AlterBBN``](https://alterbbn.hepforge.org/) to generate the file ``abundance_file.dat`` for sm.tar.gz
- Fixed a bug that prohibited running 2d parameter scans without 'fast' parameters
- Fixed a bug that caused INFO messages to be printed even for ``verbose=False``

</details><br />

<details>
<summary>v1.2.1 (February 16, 2021)</summary>

- Fixed a bug in ``DecayModel``. Results that have been obtained with older versions can be corrected by multiplying the parameter ``n0a`` with an additional factor ``2.7012``. All results of our papers remain unchanged.
- Updated the set of initial abundances to the most recent values returned by [``AlterBBN``](https://alterbbn.hepforge.org/) v2.2 (explicitly, we used ``failsafe=12``)

</details><br />

<details>
<summary>v1.2 (January 15, 2021)</summary>

- Speed improvements when running non-thermal nucleosynthesis (by a factor 7)
- Modified the directory structure by moving ./data to ./acropolis/data to transform ``ACROPOLIS`` into a proper package, which can be installed via ``python3 -m pip install . --user`` (also putting the executables ``decay`` and ``annihilation`` into your ``PATH``)
- Added the decay of neutrons and tritium to the calculation
- For AnnihilationModel, it is now possible to freely choose the dark-matter density parameter (default is 0.12)

</details><br />


<details>
<summary>v1.1 (December 1, 2020)</summary>

- For the source terms it is now possible to specify arbitrary monochromatic and continuous contributions, meaning that the latter one is no longer limited to only final-state radiation of photons
- By including additional JIT compilation steps, the runtime without database files was drastically decreased (by approximately a factor 15)
- The previously mentioned performance improvements also allowed to drop the large database files alltogether, which results in a better user experience (all database files are now part of the git repo and no additional download is required) and a significantly reduced RAM usage (&#x223C;900MB &#x2192; &#x223C;20MB)
- Fixed a bug, which could lead to NaNs when calculating heavily suppressed spectra with E<sub>0</sub> &#x226B; me<sup>2</sup>/(22T)
- Added a unified way to print the final abundances in order to declutter the wrapper scripts. This makes it easier to focus on the actual important parts when learning how to use ``ACROPOLIS``
- Moved from bytecode to simple text files for the remaining database file, as the former leads to unexpected behaviour on some machines
- Added additional info and warning messages for the user's convenience

</details><br />

<details>
<summary>v1.0 (November 12, 2020)</summary>

- Initial release

</details><br />

# Installation from PyPI
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.3.0
6 changes: 3 additions & 3 deletions acropolis/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from functools import wraps


def cached_member(f_uncached):
def cached(f):
# Define the cache as a dictionary
cache = {}
Tc = {"_": -1.}

# Define the wrapper function
@wraps(f_uncached)
@wraps(f)
def f_cached(*args):
T = args[-1]
# Drop the first argument 'self'
Expand All @@ -22,7 +22,7 @@ def f_cached(*args):
cache.clear()

if pargs not in cache:
cache[pargs] = f_uncached(*args)
cache[pargs] = f(*args)

return cache[pargs]

Expand Down
Loading

0 comments on commit 157a0a1

Please sign in to comment.