Skip to content

Commit 514edf1

Browse files
authored
Merge branch 'develop' into hdf5_link_compile_fix
2 parents d619604 + 1e23562 commit 514edf1

111 files changed

Lines changed: 5076 additions & 4134 deletions

File tree

Some content is hidden

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

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99
# apply inifix-format to all .ini files
1010
ac260f4af48221229aef4fc1f93ffbf9df450739
1111
1ca7676fee7a578bd64e64ec9b6bdfbceb921775
12+
13+
# apply ruff format to all .py files
14+
8d0437bf23d7d8007355fa35b9f094287f7de987

.pre-commit-config.yaml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,12 @@ repos:
2828

2929

3030
- repo: https://github.com/astral-sh/ruff-pre-commit
31-
rev: v0.6.9
31+
rev: v0.15.8
3232
hooks:
33-
- id: ruff
34-
args:
35-
- --quiet
36-
- --fix
37-
- --select
38-
- F # pyflakes
39-
- B # flake8-bugbear
40-
- I # isort
41-
- NPY # numpy-specific rules
42-
- --ignore
43-
- F405
44-
- --ignore
45-
- F403 # ignore import *
33+
- id: ruff-format
34+
args: [--target-version=py310]
35+
- id: ruff-check
36+
args: [--target-version=py310, --quiet, --fix, --show-fixes]
4637

4738
- repo: https://github.com/la-niche/inifix-pre-commit
4839
rev: v1.0.0

doc/python_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Other requirements
2-
# Python >= 3.7
2+
# Python >= 3.10
33
# Doxygen https://www.doxygen.nl/download.html
44
#
55
# Install Sphinx and required plugins with the following command

doc/source/conf.py

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818

1919
# -- Project information -----------------------------------------------------
2020

21-
project = 'Idefix'
22-
copyright = 'Geoffroy Lesur et al.'
23-
author = 'Geoffroy Lesur'
21+
project = "Idefix"
22+
copyright = "Geoffroy Lesur et al."
23+
author = "Geoffroy Lesur"
2424

2525
# The full version, including alpha/beta/rc tags
26-
release = '2.3.0'
27-
26+
release = "2.3.0"
2827

2928

3029
# -- General configuration ---------------------------------------------------
@@ -34,20 +33,24 @@
3433
# ones.
3534
extensions = [
3635
"sphinx_rtd_theme",
37-
'sphinx_git',
38-
'matplotlib.sphinxext.plot_directive',
36+
"sphinx_git",
37+
"matplotlib.sphinxext.plot_directive",
3938
"breathe",
4039
"exhale",
4140
"m2r2",
42-
"sphinx_copybutton"
43-
]
41+
"sphinx_copybutton",
42+
]
4443

4544
source_suffix = [".rst", ".md"]
4645

47-
cpp_id_attributes=["KOKKOS_FORCEINLINE_FUNCTION","KOKKOS_INLINE_FUNCTION","KOKKOS_RESTRICT"]
46+
cpp_id_attributes = [
47+
"KOKKOS_FORCEINLINE_FUNCTION",
48+
"KOKKOS_INLINE_FUNCTION",
49+
"KOKKOS_RESTRICT",
50+
]
4851

4952
# Add any paths that contain templates here, relative to this directory.
50-
templates_path = ['_templates']
53+
templates_path = ["_templates"]
5154

5255
# List of patterns, relative to source directory, that match files and
5356
# directories to ignore when looking for source files.
@@ -60,45 +63,47 @@
6063
# The theme to use for HTML and HTML Help pages. See the documentation for
6164
# a list of builtin themes.
6265
#
63-
html_theme = 'sphinx_rtd_theme'
66+
html_theme = "sphinx_rtd_theme"
6467

6568
# Add any paths that contain custom static files (such as style sheets) here,
6669
# relative to this directory. They are copied after the builtin static files,
6770
# so a file named "default.css" will overwrite the builtin "default.css".
68-
html_static_path = ['_static']
71+
html_static_path = ["_static"]
72+
6973

7074
def setup(app):
71-
app.add_css_file('my_theme.css')
75+
app.add_css_file("my_theme.css")
76+
7277

7378
##############
7479
# Breathe/Exhale options
7580

7681
# Setup the breathe extension
7782
breathe_projects = {
78-
"Idefix": "./xml"
83+
"Idefix": "./xml",
7984
}
8085
breathe_default_project = "Idefix"
8186

8287
# Setup the exhale extension
8388
exhale_args = {
8489
# These arguments are required
85-
"containmentFolder": "./api",
86-
"rootFileName": "library_root.rst",
87-
"rootFileTitle": "Idefix API",
90+
"containmentFolder": "./api",
91+
"rootFileName": "library_root.rst",
92+
"rootFileTitle": "Idefix API",
8893
# Suggested optional arguments
89-
"createTreeView": False,
94+
"createTreeView": False,
9095
# TIP: if using the sphinx-bootstrap-theme, you need
9196
# "treeViewIsBootstrap": True,
9297
"doxygenStripFromPath": "../../src",
9398
"exhaleExecutesDoxygen": True,
94-
"exhaleDoxygenStdin": textwrap.dedent('''
99+
"exhaleDoxygenStdin": textwrap.dedent("""
95100
INPUT = ../../src
96101
EXCLUDE = ../../src/kokkos
97-
''')
102+
"""),
98103
}
99104

100105
# Tell sphinx what the primary language being documented is.
101-
primary_domain = 'cpp'
106+
primary_domain = "cpp"
102107

103108
# Tell sphinx what the pygments highlight language should be.
104-
highlight_language = 'cpp'
109+
highlight_language = "cpp"

doc/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ MPI library
3434
the MPI library is GPU-Aware. If unsure, check this last point with your system administrator.
3535

3636
Python
37-
When using *Idefix* with its python interface through the module `Pydefix`, *Idefix* relies on an external python>=3.8 interpreter with the module `pybind11 <https://pybind11.readthedocs.io>`_
37+
When using *Idefix* with its python interface through the module `Pydefix`, *Idefix* relies on an external python>=3.10 interpreter with the module `pybind11 <https://pybind11.readthedocs.io>`_
3838
installed.
3939

4040
================

doc/source/modules/pydefix.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Before you start
1616
Pybind11 installation
1717
+++++++++++++++++++++
1818

19-
In order to use pydefix, you need to be working in a python>=3.8 environement that includes `pybind11 <https://pybind11.readthedocs.io>`_. Follow the instruction of your package manager to install pybind11>=2.12.
19+
In order to use pydefix, you need to be working in a python>=3.10 environment that includes `pybind11 <https://pybind11.readthedocs.io>`_. Follow the instructions of your package manager to install pybind11>=2.12.
2020

2121
Pydefix usage
2222
-------------

doc/source/plot_idefix_bench.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
import matplotlib.pyplot as plt
21
import json
32

3+
import matplotlib.pyplot as plt
4+
5+
46
def do_plot(title, bench_file, gpumodels):
5-
with open(bench_file, 'r') as f:
7+
with open(bench_file, "r") as f:
68
benches = json.load(f)
79

810
plt.figure()
9-
xmax=0
10-
ymax=0
11+
xmax = 0
12+
ymax = 0
1113
for gpumodel in gpumodels:
12-
select = [bench for bench in benches if bench['gpumodel'] == gpumodel][-1]
14+
select = [bench for bench in benches if bench["gpumodel"] == gpumodel][-1]
1315

14-
xs = [r['nbgpu'] for r in select['results']]
15-
ys = [r['cell_updates'] for r in select['results']]
16-
plt.plot(xs, ys,'o-',label=gpumodel)
17-
xmax=max(xmax,max(xs))
18-
ymax=max(ymax,max(ys))
16+
xs = [r["nbgpu"] for r in select["results"]]
17+
ys = [r["cell_updates"] for r in select["results"]]
18+
plt.plot(xs, ys, "o-", label=gpumodel)
19+
xmax = max(xmax, max(xs))
20+
ymax = max(ymax, max(ys))
1921

2022
plt.xscale("log", base=2)
21-
plt.ylim(0,ymax*1.1)
22-
plt.xlim(1,xmax*1.1)
23+
plt.ylim(0, ymax * 1.1)
24+
plt.xlim(1, xmax * 1.1)
2325
plt.legend()
2426
plt.xlabel("Number of GPUs/GCDs")
2527
plt.ylabel("Performance (cells / second / GPU)")

doc/source/testing/testLauncher.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ In addition there is some extra keys which are dedicated to the json interpretat
191191
* - ``multirun``
192192
- ``{}``
193193
- See the multi-run section below.
194+
* - ``callPyFunctionBefore``
195+
-
196+
- Call a python function before executing the test (see dedicated section at the end of this file).
197+
* - ``callPyFunctionAfter``
198+
-
199+
- Call a python function after executing the test (see dedicated section at the end of this file).
194200

195201
Looping over parameters
196202
-----------------------
@@ -374,6 +380,33 @@ They are described like :
374380
},
375381
}
376382
383+
Calling a Python function
384+
-------------------------
385+
386+
In some cases (example in ``test/utils/lookupTable``) you might need to call a custom
387+
python function before running the test to prepare the data or after the test to perform
388+
some extra check.
389+
390+
You can simply implement the functions you want to call in the python file in the test
391+
directory (ideally named ``testmelib.py``) :
392+
393+
.. code-block:: python
394+
395+
def callMeAtStart():
396+
print("This is called at test start !")
397+
398+
def callMeAtEnd():
399+
print("This is called at test end !")
400+
401+
And add the keys in ``testme.json``:
402+
403+
.. code-block:: json
404+
405+
"default": {
406+
"callPyFunctionBefore": "testmelib.py:callMeAtStart",
407+
"callPyFunctionAfter": "testmelib.py:callMeAtEnd"
408+
}
409+
377410
Using the idfxTest options
378411
--------------------------
379412

make_tarballs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def _make_self_contained_tarball(output_dir, *, suffix="", exclude_list=None):
8989
os.replace(os.path.join(work_dir, tarball), final_tarfile)
9090

9191
filesize = os.path.getsize(final_tarfile)
92-
print("Done ! Final file size is %.1f MB" % (filesize / 1024 ** 2))
92+
print("Done ! Final file size is %.1f MB" % (filesize / 1024**2))
9393

9494

9595
def main(argv=None):

pytools/dump_io.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
@author: lesurg
66
"""
7+
78
import os
89
import re
910
import struct
@@ -59,7 +60,7 @@ def __init__(self, fh, byteorder="little"):
5960
self.ndims = int.from_bytes(fh.read(INT_SIZE), byteorder)
6061
dims = []
6162
ntot = 1
62-
for dim in range(self.ndims):
63+
for _ in range(self.ndims):
6364
dims.append(int.from_bytes(fh.read(INT_SIZE), byteorder))
6465
ntot = ntot * dims[-1]
6566
raw = struct.unpack(str(ntot) + stringchar, fh.read(mysize * ntot))
@@ -119,6 +120,7 @@ def _read_fields(self, fh):
119120
def __repr__(self):
120121
return "DumpDataset('%s')" % self.filename
121122

123+
122124
# public API
123125
def readDump(filename):
124126
return DumpDataset(filename)

0 commit comments

Comments
 (0)