Skip to content

Commit c836408

Browse files
committed
add testing
1 parent 5f5bd4d commit c836408

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
# exfor-tools
55
Some lightweight tools to grab data from the [EXFOR database](https://www-nds.iaea.org/exfor/) using the [x4i3 library](https://github.com/afedynitch/x4i3/), and organize it for visualization and use in model calibration and uncertainty quantification.
66

7-
## use case
8-
9-
You have a reaction model $f(x,\alpha)$ and you would like to find some data $y(x)$ to constrain the $\alpha$. Here $x$ can be energy, angle, type of reaction, projectile and target, etc. You would like to do this in a statistically rigorous way, in which you take into account various types of uncertainties, including systematic uncertainties that introduce correlations between $y(x_i)$ and $y(x_j)$. You would also like to do this with large data sets comprised of many different experiments. In other words, you would like to curate a data set $y$ -- composed of reaction observables like differential cross sections -- and have the information required to construct a covariance matrix for it. And you would like it to be sorted into computationally convenient data structures that you can use for visualization, or comparison to your model. You've come to the right place.
10-
11-
12-
137
## scope
148

159
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](https://github.com/afedynitch/x4i3/).
@@ -26,9 +20,25 @@ git clone git@github.com:beykyle/exfor_tools.git --recurse-submodules
2620
pip instal exfor_tools -e
2721
```
2822

29-
## examples and tutorials
23+
## test
24+
25+
The tests and the tutorials are one and the same. To ensure they run, use:
26+
27+
```
28+
pytest --nbmake examples/
29+
```
3030

31-
Check out the tutorials:
31+
To ensure they produce the expected results, use:
32+
33+
```
34+
pyetst --nbval examples/
35+
```
36+
37+
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.
38+
39+
## tuorials
40+
41+
You can also run the notebooks in the `examples/` directory manually to see how to use the package. These include:
3242
- [examples/introductory_tutorial.ipynb](https://github.com/beykyle/exfor_tools/blob/main/examples/introductory_tutorial.ipynb)
3343
- [examples/data_curation_tutorial.ipynb](https://github.com/beykyle/exfor_tools/blob/main/examples/dataset_curation_tutorial.ipynb)
3444

@@ -51,4 +61,3 @@ echo export X43I_DATAPATH=$X43I_DATAPATH >> ~/.bashrc
5161
```
5262

5363
This functionality for modifying the database used by `x4i3` is provided in [x4i3_tools](https://github.com/afedynitch/x4i3_tools), which is included as a submodule.
54-

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ numpy>=1.21.5
22
x4i3>=1.2.0
33
periodictable>1.0
44
jitr>=2.5.1
5+
nbmake
6+
nbval
7+
pytest

0 commit comments

Comments
 (0)