Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename imaspy to imas #6

Open
wants to merge 57 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
c305fa6
renamed pyproject.toml
sawantp1 Jan 8, 2025
6a1fc87
imaspy -> imas
sawantp1 Jan 8, 2025
8cf4088
formatted with blacj
sawantp1 Jan 8, 2025
88d03d9
fixed flake8 issues
sawantp1 Jan 8, 2025
870ab00
skipped pytests which were using python hli
sawantp1 Jan 10, 2025
8bfb094
fixed formatting
sawantp1 Jan 13, 2025
cf45162
removed code which was importing imas hli as fallback
sawantp1 Jan 13, 2025
06aa20f
added ids files
sawantp1 Jan 13, 2025
78b17de
updated documentation,links and rename of images
sawantp1 Jan 13, 2025
aee6d90
updated links
sawantp1 Jan 13, 2025
5c870dd
updated dd repo
sawantp1 Jan 13, 2025
623a0c0
removed -M option
sawantp1 Jan 13, 2025
666611f
added -M option in makefile
sawantp1 Jan 14, 2025
f0af526
changed font for repo and enabled exit on error
sawantp1 Jan 14, 2025
52f1b5c
removed al4_snippets and updated documentation
sawantp1 Jan 14, 2025
3bf04ab
added workflow
prasad-sawantdesai Jan 14, 2025
c88c2b9
Merge branch 'iterorganization:develop' into rename-imaspy-to-imas
prasad-sawantdesai Jan 14, 2025
ca9cf96
added linitin and publish workflow
prasad-sawantdesai Jan 15, 2025
61d4df4
Merge branch 'rename-imaspy-to-imas' of github.com:prasad-sawantdesai…
prasad-sawantdesai Jan 15, 2025
db1811f
fixed wrong lines in the workflow
prasad-sawantdesai Jan 15, 2025
0fd25f9
fixed wrong lines in the workflow
prasad-sawantdesai Jan 15, 2025
65e1387
push dev branches
prasad-sawantdesai Jan 15, 2025
4f2b2a9
replaced versioneer with setuptools_scm
prasad-sawantdesai Jan 17, 2025
55fdb9a
added git_archival.txt
prasad-sawantdesai Jan 17, 2025
5c54bc7
kept dynamic->version in pyproject.toml and removed from setup.py
prasad-sawantdesai Jan 17, 2025
40a79a7
updated license
prasad-sawantdesai Jan 17, 2025
1b5d245
receive imas-core from hithub https
prasad-sawantdesai Jan 17, 2025
c9b7bda
removed direct dependency of imas-core
prasad-sawantdesai Jan 17, 2025
aa5cb94
included **cmd_class
prasad-sawantdesai Jan 17, 2025
e53f45d
do not raise exception if imas environment is not available
prasad-sawantdesai Jan 17, 2025
f43354f
cover with try catch exception for al methods
prasad-sawantdesai Jan 17, 2025
d56f0ba
cover with try catch exception for imas-core methods
prasad-sawantdesai Jan 17, 2025
859ab81
Merge branch 'rename-imaspy-to-imas' of github.com:prasad-sawantdesai…
prasad-sawantdesai Jan 17, 2025
450ed50
fixed merge issues with README.md
prasad-sawantdesai Jan 17, 2025
f4ae1ef
fixed formatting
prasad-sawantdesai Jan 17, 2025
2970b86
added readthedocs yml file
prasad-sawantdesai Jan 17, 2025
84ba2e9
dd_helpers uses saxonche
prasad-sawantdesai Jan 20, 2025
bd656e5
fixed typo linting.yml
prasad-sawantdesai Jan 20, 2025
4ea8771
Merge branch 'iterorganization:develop' into rename-imaspy-to-imas
prasad-sawantdesai Jan 20, 2025
9565400
Update installing.rst
olivhoenen Jan 20, 2025
f9fc94b
added tests for dd_helpers.py
prasad-sawantdesai Jan 20, 2025
52229bb
Merge branch 'rename-imaspy-to-imas' of github.com:prasad-sawantdesai…
prasad-sawantdesai Jan 20, 2025
05d2f55
removed line 0.8.0
prasad-sawantdesai Jan 20, 2025
6f0812a
renamed IMASPY_LOGLEVEL
prasad-sawantdesai Jan 20, 2025
443e9fe
Update release_imas.rst (WIP)
olivhoenen Jan 20, 2025
de7d460
updated ci plan
prasad-sawantdesai Jan 20, 2025
38f607f
IMASPY->IMAS and updated ci_config.rst
prasad-sawantdesai Jan 20, 2025
4e4200c
Merge branch 'rename-imaspy-to-imas' of github.com:prasad-sawantdesai…
prasad-sawantdesai Jan 20, 2025
d71e258
replaced versioneer to setuptools_scm documentation update #r1922478535
prasad-sawantdesai Jan 20, 2025
7420d43
Updated link
prasad-sawantdesai Jan 20, 2025
0df435f
removed non public paragraph
prasad-sawantdesai Jan 20, 2025
2386203
Updated AL4 related constructs and comments
prasad-sawantdesai Jan 20, 2025
5937fe3
imaspy->imas for changes before version 2
prasad-sawantdesai Jan 20, 2025
d416e8b
Update pyproject.toml
olivhoenen Jan 21, 2025
d7c6c5d
Update pyproject.toml
olivhoenen Jan 21, 2025
03fd8d9
fix mdsplus models and benchmark projects
prasad-sawantdesai Jan 21, 2025
78ac135
fixed benchmarks code
prasad-sawantdesai Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
imaspy/_version.py export-subst
imas/_version.py export-subst
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ ENV/
*.swo

# SCM setuptools
imaspy/version.py
imas/version.py

# Saxon symlink or downloaded file
saxon*.jar

# IMAS DD
data-dictionary
access-layer
containers/arch/imaspy/
containers/arch/imas/
containers/arch/data-dictionary/
containers/arch/access-layer/
prasad-sawantdesai marked this conversation as resolved.
Show resolved Hide resolved
imaspy/assets/IDSDef.zip
imas/assets/IDSDef.zip

# IDS files
*.ids
# *.ids

# ASV folder
/.asv
12 changes: 6 additions & 6 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include imaspy/assets/IDSDef.zip
include imaspy/assets/IDSDef2MDSpreTree.xsl
include imaspy/assets/ITER_134173_106_equilibrium.ids
include imaspy/assets/ITER_134173_106_core_profiles.ids
include imaspy/assets/equilibrium.ids
include imaspy/assets/core_profiles.ids
include imas/assets/IDSDef.zip
include imas/assets/IDSDef2MDSpreTree.xsl
include imas/assets/ITER_134173_106_equilibrium.ids
include imas/assets/ITER_134173_106_core_profiles.ids
include imas/assets/equilibrium.ids
include imas/assets/core_profiles.ids
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# IMASPy
# imas-python

IMASPy is a pure-python library to handle arbitrarily nested data structures.
IMASPy is designed for, but not necessarily bound to, interacting with Interface
imas-python is a pure-python library to handle arbitrarily nested data structures.
imas-python is designed for, but not necessarily bound to, interacting with Interface
Data Structures (IDSs) as defined by the Integrated Modelling & Analysis Suite (IMAS)
Data Model.

Expand All @@ -11,7 +11,7 @@ Data Model.
Install steps are described in the documentation generated from `/docs/source/installing.rst`.

Documentation is autogenerated from the source using [Sphinx](http://sphinx-doc.org/)
and can be found at the [ITER sharepoint](https://sharepoint.iter.org/departments/POP/CM/IMDesign/Code%20Documentation/IMASPy-doc/index.html)
and can be found at the [ITER sharepoint](https://sharepoint.iter.org/departments/POP/CM/IMDesign/Code%20Documentation/imas-python-doc/index.html)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link doesn't work


The documentation can be manually generated by installing sphinx and running:

Expand All @@ -23,15 +23,15 @@ make -C docs html
## How to use

```python
import imaspy
factory = imaspy.IDSFactory()
import imas
factory = imas.IDSFactory()
equilibrium = factory.equilibrium()
print(equilibrium)

equilibrium.ids_properties.homogeneous_time = imaspy.ids_defs.IDS_TIME_MODE_HETEROGENEOUS
equilibrium.ids_properties.homogeneous_time = imas.ids_defs.IDS_TIME_MODE_HETEROGENEOUS
equilibrium.ids_properties.comment = "testing"

with imaspy.DBEntry("imas:hdf5?path=./testdb","w") as dbentry:
with imas.DBEntry("imas:hdf5?path=./testdb","w") as dbentry:
dbentry.put(equilibrium)
```

Expand All @@ -40,7 +40,7 @@ A quick 5 minutes introduction is available in the documentation generated from

## Legal

IMASPy is Copyright 2020-2024 ITER Organization, Copyright 2020-2023 Karel Lucas van de
imas-python is Copyright 2020-2024 ITER Organization, Copyright 2020-2023 Karel Lucas van de
Plassche <karelvandeplassche@gmail.com>, Copyright 2020-2022 Daan van Vugt <dvanvugt@ignitioncomputing.com>,
and Copyright 2020 Dutch Institute for Fundamental Energy Research <info@differ.nl>.
It is licensed under [LGPL 3.0](LICENSE.txt).
Expand Down
6 changes: 3 additions & 3 deletions asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"version": 1,

// The name of the project being benchmarked
"project": "imaspy",
"project": "imas",

// The project's homepage
"project_url": "https://git.iter.org/projects/IMAS/repos/imaspy/browse",
"project_url": "https://github.com/iterorganization/imas-python",

// The URL or local path of the source code repository for the
// project being benchmarked
Expand Down Expand Up @@ -53,7 +53,7 @@
//"install_timeout": 600,

// the base URL to show a commit for the project.
"show_commit_url": "https://git.iter.org/projects/IMAS/repos/imaspy/commits/",
"show_commit_url": "https://github.com/iterorganization/imas-python/commits/main/",

// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
Expand Down
18 changes: 9 additions & 9 deletions benchmarks/core_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy as np

import imaspy
import imas

from .utils import (
available_backends,
Expand All @@ -22,16 +22,16 @@ def fill_slices(core_profiles, times):
"""Fill a time slice of a core_profiles IDS with generated data.

Args:
core_profiles: core_profiles IDS (either from IMASPy or AL HLI)
core_profiles: core_profiles IDS (either from imas-python or AL HLI)
times: time values to fill a slice for
"""
core_profiles.ids_properties.homogeneous_time = 1 # HOMOGENEOUS
core_profiles.ids_properties.comment = "Generated for the IMASPy benchmark suite"
core_profiles.ids_properties.comment = "Generated for the imas-python benchmark suite"
core_profiles.ids_properties.creation_date = datetime.date.today().isoformat()
core_profiles.code.name = "IMASPy ASV benchmark"
core_profiles.code.version = imaspy.__version__
core_profiles.code.name = "imas-python ASV benchmark"
core_profiles.code.version = imas.__version__
core_profiles.code.repository = (
"https://git.iter.org/projects/IMAS/repos/imaspy/browse"
"https://github.com/iterorganization/imas-python"
)

core_profiles.time = np.array(times)
Expand Down Expand Up @@ -74,7 +74,7 @@ def setup(self, hli, backend):

def time_get_slice(self, hli, backend):
for t in TIME:
self.dbentry.get_slice("core_profiles", t, imaspy.ids_defs.CLOSEST_INTERP)
self.dbentry.get_slice("core_profiles", t, imas.ids_defs.CLOSEST_INTERP)

def teardown(self, hli, backend):
if hasattr(self, "dbentry"): # imas + netCDF has no dbentry
Expand All @@ -96,8 +96,8 @@ class LazyGet:
param_names = ["lazy", "backend"]

def setup(self, lazy, backend):
self.dbentry = create_dbentry("imaspy", backend)
core_profiles = factory["imaspy"].core_profiles()
self.dbentry = create_dbentry("imas", backend)
core_profiles = factory["imas"].core_profiles()
fill_slices(core_profiles, TIME)
self.dbentry.put(core_profiles)

Expand Down
14 changes: 7 additions & 7 deletions benchmarks/edge_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy as np

import imaspy
import imas

from .utils import available_backends, create_dbentry, factory, hlis

Expand All @@ -17,18 +17,18 @@ def fill_ggd(edge_profiles, times):
"""Fill nested arrays of structures in grids_ggd and ggd substructures.

Args:
edge_profiles: edge_profiles IDS object (either from IMASPy or AL HLI)
edge_profiles: edge_profiles IDS object (either from imas-python or AL HLI)
times: time values to fill
"""
edge_profiles.ids_properties.homogeneous_time = (
imaspy.ids_defs.IDS_TIME_MODE_HETEROGENEOUS
imas.ids_defs.IDS_TIME_MODE_HETEROGENEOUS
)
edge_profiles.ids_properties.comment = "Generated for IMASPy benchmark suite"
edge_profiles.ids_properties.comment = "Generated for imas-python benchmark suite"
edge_profiles.ids_properties.creation_date = datetime.date.today().isoformat()
edge_profiles.code.name = "IMASPy ASV benchmark"
edge_profiles.code.version = imaspy.__version__
edge_profiles.code.name = "imas-python ASV benchmark"
edge_profiles.code.version = imas.__version__
edge_profiles.code.repository = (
"https://git.iter.org/projects/IMAS/repos/imaspy/browse"
"https://github.com/iterorganization/imas-python"
)

# This GGD grid is not a valid description, but it's a good stress test for the
Expand Down
16 changes: 8 additions & 8 deletions benchmarks/technical.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import imaspy
import imas
import imas


def timeraw_create_default_imaspy_factory():
def timeraw_create_default_imas_factory():
# timeraw to ensure that nothing is cached
return """
import imaspy
imaspy.IDSFactory()
import imas
imas.IDSFactory()
"""


def timeraw_import_imaspy():
def timeraw_import_imas():
return """
import imaspy
import imas
"""


Expand All @@ -38,6 +38,6 @@ def track_imas_versions():
)


def track_imaspy_dd_version():
return imaspy.IDSFactory().version
def track_imas_dd_version():
return imas.IDSFactory().version
"""
22 changes: 11 additions & 11 deletions benchmarks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import uuid
from pathlib import Path

import imaspy
import imaspy.exception
import imas
import imas.exception

# Don't directly import imas: code analyzers break on the huge code base
imas = importlib.import_module("imas")
Expand All @@ -28,11 +28,11 @@ def backend_exists(backend):
"""Tries to detect if the lowlevel has support for the given backend."""
uri = create_uri(backend, str(uuid.uuid4()))
try:
entry = imaspy.DBEntry(uri, "r")
entry = imas.DBEntry(uri, "r")
except Exception as exc:
if "backend is not available" in str(exc):
return False
elif isinstance(exc, (imaspy.exception.ALException, FileNotFoundError)):
elif isinstance(exc, (imas.exception.ALException, FileNotFoundError)):
return True
return True
# Highly unlikely, but it could succeed without error
Expand Down Expand Up @@ -60,32 +60,32 @@ def backend_exists(backend):
backend for backend in available_backends if backend not in [ASCII, NETCDF]
]

hlis = ["imas", "imaspy"]
hlis = ["imas", "imas"]
prasad-sawantdesai marked this conversation as resolved.
Show resolved Hide resolved
DBEntry = {
"imas": imas.DBEntry,
"imaspy": imaspy.DBEntry,
"imas": imas.DBEntry,
}
factory = {
"imas": imas,
"imaspy": imaspy.IDSFactory(),
"imas": imas.IDSFactory(),
}
available_serializers = [imaspy.ids_defs.ASCII_SERIALIZER_PROTOCOL]
available_serializers = [imas.ids_defs.ASCII_SERIALIZER_PROTOCOL]


def create_dbentry(hli, backend):
if backend == NETCDF:
if hli == "imas":
# Raising NotImplementedError will skip the benchmarks for this combination
raise NotImplementedError("AL-Python HLI doesn't implement netCDF.")
if hli == "imaspy": # check if netcdf backend is available
if hli == "imas": # check if netcdf backend is available
try:
assert (
imaspy.DBEntry._select_implementation("x.nc").__name__
imas.DBEntry._select_implementation("x.nc").__name__
== "NCDBEntryImpl"
)
except (AttributeError, AssertionError):
raise NotImplementedError(
"This version of IMASPy doesn't implement netCDF."
"This version of imas-python doesn't implement netCDF."
) from None

path = Path.cwd() / f"DB-{hli}-{backend}"
Expand Down
2 changes: 1 addition & 1 deletion ci/build_dd_zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ echo "Done loading modules"
set -x

# Build the DD zip
python imaspy/dd_helpers.py
python imas/dd_helpers.py
4 changes: 2 additions & 2 deletions ci/build_docs_and_dist.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Bamboo CI script to install imaspy and run all tests
# Bamboo CI script to install imas and run all tests
# Note: this script should be run from the root of the git repository

# Debuggging:
Expand Down Expand Up @@ -27,7 +27,7 @@ pip install --upgrade pip setuptools wheel build
rm -rf dist
python -m build .

# Install imaspy and documentation dependencies from the just-built wheel
# Install imas and documentation dependencies from the just-built wheel
pip install "`readlink -f dist/*.whl`[docs,netcdf]"

# Debugging:
Expand Down
4 changes: 2 additions & 2 deletions ci/linting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ python -m venv venv
# Install and run linters
pip install --upgrade 'black >=24,<25' flake8

black --check imaspy
flake8 imaspy
black --check imas
flake8 imas
12 changes: 6 additions & 6 deletions ci/run_benchmark.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Bamboo CI script to install imaspy and run all tests
# Bamboo CI script to install imas and run all tests
# Note: this script should be run from the root of the git repository

# Debuggging:
Expand All @@ -24,17 +24,17 @@ rm -rf venv # Environment should be clean, but remove directory to be sure
python -m venv venv
source venv/bin/activate

# Install asv and imaspy
# Install asv and imas
pip install --upgrade pip setuptools wheel
pip install virtualenv .[test]

# Generate MDS+ models cache
python -c 'import imaspy.backends.imas_core.mdsplus_model; print(imaspy.backends.imas_core.mdsplus_model.mdsplus_model_dir(imaspy.IDSFactory()))'
python -c 'import imas.backends.imas_core.mdsplus_model; print(imas.backends.imas_core.mdsplus_model.mdsplus_model_dir(imas.IDSFactory()))'

# Copy previous results (if any)
mkdir -p /mnt/bamboo_deploy/imaspy/benchmarks/results
mkdir -p /mnt/bamboo_deploy/imas/benchmarks/results
mkdir -p .asv
cp -rf /mnt/bamboo_deploy/imaspy/benchmarks/results .asv/
cp -rf /mnt/bamboo_deploy/imas/benchmarks/results .asv/

# Ensure numpy won't do multi-threading
export OPENBLAS_NUM_THREADS=1
Expand All @@ -61,5 +61,5 @@ fi
asv publish

# And persistently store them
cp -rf .asv/{results,html} /mnt/bamboo_deploy/imaspy/benchmarks/
cp -rf .asv/{results,html} /mnt/bamboo_deploy/imas/benchmarks/

6 changes: 3 additions & 3 deletions ci/run_pytest.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Bamboo CI script to install imaspy and run all tests
# Bamboo CI script to install imas and run all tests
# Note: this script should be run from the root of the git repository

# Debuggging:
Expand All @@ -22,7 +22,7 @@ rm -rf venv # Environment should be clean, but remove directory to be sure
python -m venv venv
source venv/bin/activate

# Install imaspy and test dependencies
# Install imas and test dependencies
pip install --upgrade pip setuptools wheel
pip install .[h5py,netcdf,test]

Expand All @@ -34,4 +34,4 @@ pip freeze
rm -f junit.xml
rm -rf htmlcov

python -m pytest -n=auto --cov=imaspy --cov-report=term-missing --cov-report=html --junit-xml=junit.xml
python -m pytest -n=auto --cov=imas --cov-report=term-missing --cov-report=html --junit-xml=junit.xml
Loading