Skip to content

Commit e9a1af1

Browse files
authored
Merge pull request #2 from melekderman/main
Merge v1.0.0 release
2 parents 38a90a6 + 865b834 commit e9a1af1

55 files changed

Lines changed: 3664 additions & 704 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

26-
- name: Install dependencies
26+
- name: Install package with dev dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
pip install numpy h5py endf pytest
29+
pip install -e ".[dev]"
3030
3131
- name: Run tests
3232
run: |
@@ -50,3 +50,55 @@ jobs:
5050
5151
- name: Ruff check
5252
run: ruff check pyepics/
53+
54+
build:
55+
name: Build distributions
56+
runs-on: ubuntu-latest
57+
needs: [test, lint]
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Set up Python
62+
uses: actions/setup-python@v5
63+
with:
64+
python-version: "3.13"
65+
66+
- name: Install build tools
67+
run: |
68+
python -m pip install --upgrade pip
69+
pip install build
70+
71+
- name: Build sdist and wheel
72+
run: python -m build
73+
74+
- name: Verify distributions
75+
run: |
76+
pip install dist/*.whl
77+
python -c "import pyepics; print(pyepics.__version__)"
78+
79+
- name: Upload artifacts
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: dist
83+
path: dist/
84+
85+
# Template for PyPI publishing — enable when ready.
86+
# Uses trusted publishing (OIDC), no secrets required.
87+
# See: https://docs.pypi.org/trusted-publishers/
88+
#
89+
# publish:
90+
# name: Publish to PyPI
91+
# runs-on: ubuntu-latest
92+
# needs: [build]
93+
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
94+
# permissions:
95+
# id-token: write
96+
# environment:
97+
# name: pypi
98+
# url: https://pypi.org/p/epics
99+
# steps:
100+
# - uses: actions/download-artifact@v4
101+
# with:
102+
# name: dist
103+
# path: dist/
104+
# - uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/docs.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,31 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
pip install numpy h5py endf sphinx sphinx-rtd-theme myst-parser
27+
pip install -e ".[dev]"
2828
29-
- name: Build docs
29+
- name: Build docs (strict — fail on warnings)
3030
run: |
3131
cd docs
32-
make html
32+
make html SPHINXOPTS="-W --keep-going"
33+
34+
- name: Verify autodoc coverage
35+
run: |
36+
cd docs
37+
python -c "
38+
import importlib, inspect, sys
39+
sys.path.insert(0, '..')
40+
import pyepics
41+
public = [name for name in pyepics.__all__ if not name.startswith('_')]
42+
missing = []
43+
for name in public:
44+
obj = getattr(pyepics, name)
45+
if callable(obj) and not inspect.getdoc(obj):
46+
missing.append(name)
47+
if missing:
48+
print(f'Missing docstrings: {missing}')
49+
sys.exit(1)
50+
print(f'All {len(public)} public symbols have docstrings.')
51+
"
3352
3453
- name: Deploy to GitHub Pages
3554
if: github.ref == 'refs/heads/main' && github.event_name == 'push'

.github/workflows/workflow.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-n-publish:
9+
name: Build and publish to PyPI
10+
runs-on: ubuntu-latest
11+
environment: pypi
12+
permissions:
13+
id-token: write
14+
contents: read
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.x"
22+
23+
- name: Install build dependencies
24+
run: python -m pip install build
25+
26+
- name: Build binary wheel and source tarball
27+
run: python -m build
28+
29+
- name: Publish to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ __pycache__/
33
*.py[codz]
44
*$py.class
55

6+
# Data directory (downloaded ENDF, generated HDF5)
7+
data/
8+
69
# Generated reports
7-
reports/
10+
tests/reports/
811

912
# C extensions
1013
*.so

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Changelog
2+
3+
All notable changes to PyEPICS are documented in this file.
4+
5+
## [1.0.0] — 2026-02-15
6+
7+
### Added
8+
9+
- **Combined MCDC HDF5 output**: Each element now produces a single HDF5
10+
file (e.g. `Fe.h5`) containing `electron_reactions`, `photon_reactions`,
11+
and `atomic_relaxation` groups together.
12+
- `create_combined_mcdc_hdf5()` — new public API for writing combined files.
13+
- `write_mcdc_combined()` — low-level writer accepting EEDL/EPDL/EADL datasets.
14+
- Full **EPDL** (photon) support: reader, raw HDF5, MCDC HDF5 — cross sections,
15+
form factors, photoelectric subshells, pair production.
16+
- Full **EADL** (atomic relaxation) support: reader, raw HDF5, MCDC HDF5 —
17+
subshell binding energies, radiative/non-radiative transitions,
18+
fluorescence and Auger yields.
19+
- `EPICSClient` — high-level API for querying element properties across
20+
all three libraries (EEDL, EPDL, EADL).
21+
- `ElementProperties` — container with binding energies, cross sections,
22+
fluorescence data, and transition energies.
23+
- CLI tool (`epics`) for download, raw, mcdc, and full pipeline execution.
24+
- Sphinx documentation with API reference, data-sources guide, and pipeline docs.
25+
- 164 unit tests covering readers, converters, mapping completeness, and pipeline.
26+
- PDF regression-test report generator.
27+
28+
### Changed
29+
30+
- **PyPI package name** changed from `pyepics-data` to `epics`.
31+
Import name remains `pyepics` (`import pyepics`).
32+
- Electron-specific constants renamed for clarity:
33+
`MF_MT``ELECTRON_MF_MT`,
34+
`SECTIONS_ABBREVS``ELECTRON_SECTIONS_ABBREVS`,
35+
`SUBSHELL_LABELS``ELECTRON_SUBSHELL_LABELS`.
36+
Old names kept as backward-compatible aliases.
37+
- MCDC CLI now produces one combined file per element in `data/mcdc/`
38+
(previously separated into `data/mcdc/electron/`, `photon/`, `atomic/`).
39+
40+
## [0.1.0] — 2026-12-18
41+
42+
### Added
43+
44+
- Initial release with EEDL (electron) reader and HDF5 converter.
45+
- Basic constant dictionaries and utility functions.
46+
- PyEEDL backward-compatibility layer (`pyepics.pyeedl_compat`).

INSTALL.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Installing PyEPICS
2+
3+
## Supported Python Versions
4+
5+
PyEPICS requires **Python 3.11 or later** (3.11, 3.12, 3.13).
6+
7+
## Quick Install from PyPI
8+
9+
```bash
10+
pip install epics
11+
```
12+
13+
This installs the core package with the minimum required dependencies
14+
(`numpy`, `h5py`, `endf`).
15+
16+
## Optional Extras
17+
18+
PyEPICS defines optional dependency groups you can install as needed:
19+
20+
| Extra | What it adds | Install command |
21+
|------------|-------------------------------------|------------------------------------------|
22+
| `download` | `requests`, `beautifulsoup4` | `pip install "epics[download]"` |
23+
| `pandas` | `pandas` | `pip install "epics[pandas]"` |
24+
| `plot` | `matplotlib` | `pip install "epics[plot]"` |
25+
| `all` | All optional dependencies | `pip install "epics[all]"` |
26+
| `dev` | Testing + linting + docs tooling | `pip install "epics[dev]"` |
27+
28+
### Examples
29+
30+
```bash
31+
# Core only (reading ENDF files and converting to HDF5)
32+
pip install epics
33+
34+
# With plotting and pandas for interactive exploration
35+
pip install "epics[plot,pandas]"
36+
37+
# Everything (including download support)
38+
pip install "epics[all]"
39+
```
40+
41+
## Developer Install
42+
43+
Clone the repository and install in editable mode with development
44+
dependencies:
45+
46+
```bash
47+
git clone https://github.com/melekderman/PyEPICS.git
48+
cd PyEPICS
49+
50+
# Create a virtual environment (recommended)
51+
python -m venv .venv
52+
source .venv/bin/activate # Linux/macOS
53+
# .venv\Scripts\activate # Windows
54+
55+
# Editable install with dev dependencies
56+
pip install -e ".[dev]"
57+
```
58+
59+
This gives you:
60+
61+
- `pytest` for running tests
62+
- `ruff` for linting
63+
- `sphinx`, `sphinx-rtd-theme`, `myst-parser` for building docs
64+
- All optional runtime dependencies (`pandas`, `matplotlib`, etc.)
65+
66+
## Running Tests
67+
68+
```bash
69+
# Run all tests
70+
python -m pytest tests/ -v
71+
72+
# Run only the client API tests
73+
python -m pytest tests/test_client.py -v
74+
75+
# Run with coverage (if pytest-cov is installed)
76+
python -m pytest tests/ --cov=pyepics --cov-report=term-missing
77+
```
78+
79+
## Building Documentation
80+
81+
```bash
82+
cd docs
83+
pip install -r requirements.txt # if not using [dev] extra
84+
make html
85+
```
86+
87+
The built HTML will be in `docs/_build/html/`.
88+
89+
## Building Distributions
90+
91+
To build source and wheel distributions for publishing:
92+
93+
```bash
94+
pip install build
95+
python -m build
96+
```
97+
98+
This produces:
99+
100+
```
101+
dist/
102+
├── epics-0.1.0.tar.gz # sdist
103+
└── epics-0.1.0-py3-none-any.whl # wheel
104+
```
105+
106+
## Verifying the Install
107+
108+
After installation, verify everything works:
109+
110+
```python
111+
import pyepics
112+
print(pyepics.__version__) # "0.1.0"
113+
114+
# Check that the client API is available
115+
from pyepics import EPICSClient
116+
print("EPICSClient loaded successfully")
117+
```
118+
119+
## Platform Notes
120+
121+
- **macOS / Linux / Windows**: All supported via pure-Python code.
122+
Binary dependencies (`numpy`, `h5py`) provide pre-built wheels for
123+
all major platforms.
124+
- **Conda**: You can also install dependencies via conda-forge:
125+
126+
```bash
127+
conda install numpy h5py
128+
pip install epics
129+
```

0 commit comments

Comments
 (0)