Skip to content

Commit 212548b

Browse files
authored
Merge pull request #474 from MC-kit/devel
Change pyproject.toml to Poetry 2.0 format
2 parents dc2b703 + bd8d31c commit 212548b

16 files changed

+1549
-1852
lines changed

.github/constraints.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pip==24.3.1
2-
poetry==1.8.4
2+
poetry==2.0.0
33

.pre-commit-config.yaml

+12-3
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,22 @@ repos:
2424
rev: "v5.0.0"
2525
hooks:
2626
- id: check-added-large-files
27+
exclude: poetry.lock
2728
- id: check-ast
2829
- id: check-case-conflict
2930
- id: check-executables-have-shebangs
3031
- id: check-json
3132
exclude: notebooks
3233
- id: check-merge-conflict
34+
exclude: \.rst$
3335
- id: check-shebang-scripts-are-executable
3436
exclude: notebooks # jupytext creates python scripts with shebangs but without permissions
3537
- id: check-symlinks
3638
- id: check-toml
3739
- id: check-yaml
3840
- id: debug-statements
41+
- id: destroyed-symlinks
42+
- id: detect-private-key
3943
- id: end-of-file-fixer
4044
exclude: data|.ipynb$|^\.
4145
- id: name-tests-test
@@ -57,7 +61,7 @@ repos:
5761
- id: remove-tabs
5862

5963
- repo: https://github.com/pre-commit/pre-commit
60-
rev: v4.0.1
64+
rev: v4.1.0
6165
hooks:
6266
- id: validate_manifest
6367

@@ -68,6 +72,11 @@ repos:
6872
- id: pydocstringformatter
6973
exclude: _parser\.py$|_tab\.py|extern
7074

75+
- repo: https://github.com/fredrikaverpil/creosote
76+
rev: v4.0.0
77+
hooks:
78+
- id: creosote
79+
7180
- repo: local
7281
hooks:
7382
# Upgrade Python code
@@ -111,15 +120,15 @@ repos:
111120
# exclude: ^notebooks|^extern
112121

113122
- repo: https://github.com/astral-sh/ruff-pre-commit
114-
rev: v0.8.4
123+
rev: v0.9.4
115124
hooks:
116125
- id: ruff
117126
exclude: ^notebooks|^extern
118127
- id: ruff-format
119128
exclude: ^notebooks|^extern|ipynb$
120129

121130
- repo: https://github.com/python-poetry/poetry
122-
rev: "1.8.0"
131+
rev: "2.0.1"
123132
hooks:
124133
- id: poetry-check
125134
- id: poetry-lock

README.rst

+20-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
==============================================================================
2-
*xpypact*: FISPACT output to Polars or DuckDB converter
2+
*xpypact*: FISPACT output to Polars or DuckDB datasets converter
33
==============================================================================
44

5+
Aggregate results of `FISPACT <https://fispact.ukaea.uk/>`_ runs to efficient datasets.
56

67

78
|Maintained| |License| |Versions| |PyPI| |Docs|
@@ -16,26 +17,22 @@
1617
Description
1718
-----------
1819

19-
The module loads FISPACT JSON output files and converts to Polars dataframes
20-
with minor data normalization.
21-
This allows efficient data extraction and aggregation.
22-
Multiple JSON files can be combined using simple additional identification for different
23-
FISPACT runs. So far we use just two-dimensional identification by material
24-
and case. The case usually identifies certain neutron flux.
20+
The module loads FISPACT JSON output files and converts to `Polars <https://pola.rs/>`_ dataframes
21+
with minor data normalization. The dataframes can be stored either to `parquet <https://parquet.apache.org>`_
22+
files or `DuckDb <https://duckdb.org/>`_ database.
23+
This allows efficient data aggregation and analysis.
24+
**Multiple** JSON files for different
25+
FISPACT runs can be combined using simple additional identification.
26+
So far, we use just two-dimensional identification by material
27+
and *case*. The *case* usually identifies certain neutron flux energy distribution.
2528

2629

2730
Implemented functionality
2831
-------------------------
2932

3033
- export to DuckDB
3134
- export to parquet files
32-
33-
.. note::
34-
35-
Currently available FISPACT v.5 API uses rather old python version (3.6).
36-
That prevents direct use of their API in our package (>=3.10).
37-
Check if own python integration with FISPACT is reasonable and feasible.
38-
Or provide own FISPACT python binding.
35+
- neutron flux presentation conversion
3936

4037

4138
Installation
@@ -165,16 +162,13 @@ Contributing
165162
.. image:: https://codecov.io/gh/MC-kit/xpypact/branch/master/graph/badge.svg?token=P6DPGSWM94
166163
:target: https://codecov.io/gh/MC-kit/xpypact
167164
:alt: Coverage
168-
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
169-
:target: https://github.com/psf/black
170-
.. image:: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336
171-
:target: https://pycqa.github.io/isort/
172165
.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
173166
:target: https://github.com/pre-commit/pre-commit
174167
:alt: pre-commit
175-
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json
176-
:target: https://github.com/charliermarsh/ruff
177-
:alt: linter
168+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
169+
:target: https://github.com/astral-sh/ruff
170+
:alt: linter & style
171+
178172

179173
Just follow ordinary practice:
180174

@@ -185,13 +179,15 @@ Just follow ordinary practice:
185179
References
186180
----------
187181

188-
.. note::
189-
190-
add references to FISPACT, pypact and used tools: poetry etc
182+
- `FISPACT <https://fispact.ukaea.uk/>`_
183+
- `FISPACT-II tools (including pypact) repositories <https://github.com/fispact>`_
184+
- `FISPACT at NEA/OECD <https://oecd-nea.org/tools/abstract/detail/NEA-1890>`_
185+
- `FISPACT introduction <https://indico.ictp.it/event/7994/session/5/contribution/24/material/slides/0.pdf>`_
191186

192187

193188
.. Substitutions
194189
190+
195191
.. |Maintained| image:: https://img.shields.io/badge/Maintained%3F-yes-green.svg
196192
:target: https://github.com/MC-kit/xpypact/graphs/commit-activity
197193
.. |Tests| image:: https://github.com/MC-kit/xpypact/workflows/Tests/badge.svg

benchmarks/test_inventory.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
from xpypact.inventory import from_json
1515

1616
if TYPE_CHECKING:
17+
from collections.abc import Callable
18+
1719
from xpypact.inventory import Inventory
1820

1921
EXPECTED_TIME_STEPS = 65
@@ -23,7 +25,7 @@
2325
AG_1_TEXT = fid.read().decode("utf-8")
2426

2527

26-
def test_load_from_string(benchmark) -> None:
28+
def test_load_from_string(benchmark: Callable) -> None:
2729
"""Loading from string."""
2830
inventory: Inventory = benchmark(from_json, AG_1_TEXT)
2931
assert len(inventory.inventory_data) == EXPECTED_TIME_STEPS

0 commit comments

Comments
 (0)