Skip to main content

A lightweight interface to grab and organize differential cross sections from EXFOR, using the x4i3 library.

Project description

Python package PyPI publisher

exfor-tools

Some lightweight tools to grab data from the EXFOR database using the x4i3 library, and organize it for visualization and use in model calibration and uncertainty quantification.

scope

Currently, exfor_tools supports most reactions in EXFOR, but only a small subset of the observables/quantities. Feel free to contribute! If it doesn't meet your needs check out the project it's built on, which is far more complete: x4i3.

quick start

 pip install exfor-tools

Package hosted at pypi.org/project/exfor-tools/. Otherwise, for development, simply clone the repo and install locally:

git clone git@github.com:beykyle/exfor_tools.git --recurse-submodules
pip instal exfor_tools -e 

tutorials

You can run the notebooks in the examples/ directory to see how to use the package.

To run the notebooks, some additional dependencies are required:

pip install -r examples/requirements.txt

There are two directories in examples/: examples/examples_2025_release/ and examples/examples_2023_release/. The former contains notebooks with stored outputs valid for the latest EXFOR release, while the latter contains notebooks with stored outputs valid for the 2023-04-29 release. You can run either one, the only difference is the stored outputs (which are used for testing).

The examples include:

These demonstrate how to query for and parse exfor entries, and curate and plot data sets. In the first one, you will produce this figure:

test

The tests and the examples are one and the same. To run the tests, first install the dependencies for the notebooks:

pip install -r examples/requirements.txt

Then, to test that the notebooks run, use:

pytest --nbmake examples/examples_2025_release/

To test that they produce the expected results, use:

pytest --nbval-lax examples/examples_2025_release/

Note that there may be some difference in your installation, e.g. if you're using a different version of the EXFOR database, so the expected results may not be exactly the same as those in the tutorials.

By default, x4i3 ships with the 2023-04-29 EXFOR release. There are a set of notebooks with stored outputs valid for that release in examples/examples_2023_release/. These are used in the github actions. If you haven't updated to a more recent release but you would like to run the tests, then simply run:

pytest --nbval-lax examples/examples_2023_release/

updating the EXFOR data base

First, download your desired version <exfor-YYYY.zip> from here: https://nds.iaea.org/nrdc/exfor-master/list.html. The latest is recomended. Then:

bash update_database.sh </path/to/exfor-XXXX.zip> --db-dir </path/where/db/should/go/>

This will extract and process the data to </path/where/db/should/go/unpack_exfor-YYYY/X4-YYYY-12-31>, setting the environment variable $X43I_DATAPATH accordingly. x4i3 uses this environment variable to find the database on import, so you should add this to your environment setup. If you use bash, this will look something like this:

echo export X43I_DATAPATH=$X43I_DATAPATH >> ~/.bashrc

This functionality for modifying the database used by x4i3 is provided in x4i3_tools, which is included as a submodule.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exfor_tools-1.1.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exfor_tools-1.1-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file exfor_tools-1.1.tar.gz.

File metadata

  • Download URL: exfor_tools-1.1.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for exfor_tools-1.1.tar.gz
Algorithm Hash digest
SHA256 826a1f4c0a953fe3a6189bb76db0c9df087eb78f41e1c08bd2db7699f432b286
MD5 569b637a71ae0db37eaf147604c07000
BLAKE2b-256 d315054eea4e79b7bd90e4dc02e19477ddd36de64e70ef25bf85805c4990da3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for exfor_tools-1.1.tar.gz:

Publisher: pypi-publish.yml on beykyle/exfor_tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file exfor_tools-1.1-py3-none-any.whl.

File metadata

  • Download URL: exfor_tools-1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for exfor_tools-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 927fec24fa4c65a0effd09de1e02e7c900bcefd5d8757a4aa9ec4dc06a125620
MD5 d3453df77b6badbea76191e730100d9a
BLAKE2b-256 5e23298c9287ff38336f12969535fa12c7a5a30f5873acd214e78d9e3c1ffb61

See more details on using hashes here.

Provenance

The following attestation bundles were made for exfor_tools-1.1-py3-none-any.whl:

Publisher: pypi-publish.yml on beykyle/exfor_tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page