Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring and Multiprocessing #21

Open
wants to merge 104 commits into
base: master
Choose a base branch
from

Conversation

lorenzomag
Copy link
Collaborator

This PR is dependant on the approval and merging of PR #17

The optimisation branch includes several performance improvements and optimizations to enhance the efficiency and speed of the codebase.

  • Code execution on import in wimprates/electron.py has been removed to reduce significant overhead.
  • Runtime caching using functools.lru_cache method was applied to a few functions
  • Optional long-term caching system has been implemented to save and load results of wrimprates.rate_wimp if arguments and wimprates' version are the same.
  • The migdal.py module can now run using a multiprocessing pool to significantly decrease runtime. Code refactoring was necessary to allow for pickling of worker functions.

Cox's package relies on relative paths to run.
It assumes the main Python process is running in its root dir.
This wrapper runs the necessary methods within the root of the submodule
and then moves the working dir back to the original one.
It returns a configured instance of the Migdal class from the submodule
for which the probabilities and total probabilities have already been
computed.
Refactored the code so that the Migdal model can be selected using a simple keyword argument. Examples will be prepared in the notebooks/ dir.

Two tests have been added:
 - One for Cox's full model for single ionization rates
 - One for Cox's model using dipole approximation
This reverts commit e0d51d4.
Without it, pytests do not recognise wimprates.data.migdal.Cox modules
Bump action versions.

Use `pip install -e .` instead of `python setup.py develop` as the latter is now deprecated.

Trying to fix issue with jinja2 being deprecated.
The following error arises while `Test package` executes in the workflow.

The following suggestion was followed: d2l-ai/d2l-book#46 (comment)
Recursively checkout submodules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant