Skip to content

Release/2.0.0 #25

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

Merged
merged 114 commits into from
Mar 19, 2025
Merged

Release/2.0.0 #25

merged 114 commits into from
Mar 19, 2025

Conversation

olivhoenen
Copy link
Collaborator

@olivhoenen olivhoenen commented Mar 17, 2025

It's time to prepare the next release (first one after renaming hence the bump in major version).

Todo

  • rebase on top of main
  • update changelog
  • ensure all tests pass on bamboo (w.r.t imas-core)
  • check if documentation builds successfully (i.e. without errors/warnings)
  • check if version of built package is set correctly

maarten-ic and others added 30 commits July 9, 2024 13:55
In preparation for validating the NC data
Feature not yet implemented, see IMAS-5593
Merge in IMAS/imaspy from feature/refactor-nc2ids to develop

* commit 'd59fcabc29d5691004649bcf48016255010d7fa7':
  Add missing docstring
  Make the NC2IDS reader class-based
Ensure lazy contexts belonging to a different IDS are always closed.
See IMAS-5603 for more details.
… same HDF5 DBEntry

Merge in IMAS/imaspy from bugfix/IMAS-5603 to develop

* commit 'e5246464d588069af3f0f25e5a0e00d41d7fd4ef':
  Fix a bug with lazy loading multiple IDSs from the same HDF5 DBEntry
Also fix a couple of bugs when opening invalid netCDF files and raise a proper exception.
Merge in IMAS/imaspy from feature/IMAS-3885-IMASPy-get_sample to develop

* commit 'afb8c292c6527f03354ac35fa43dfaebd8fb4ef3':
  Update `get_sample` docstring to clarify that the interpolation mode has no effect on the `ids.time` vector.
  Disable MDSplus backend tests for get_sample
  Set `begin_timerange_action` as available since AL core 5.4
  Update NCDBEntryImpl for get_sample and raise NotImplementedError
  Update tests for DD 4.0.0
  Add docstrings for GetSliceParameters / GetSampleParameters
  Implement `DBEntry.get_sample` in IMASPy
Merge in IMAS/imaspy from feature/cli_validate_nc to develop

* commit 'fc2cbf20b3cf1c549761214109d3d89b4ee34091':
  Additional documentation for the `imaspy validate_nc` command line tool
  Add unit tests for `nc_validate.py`
  Close netCDF datasets when an exception is raised
  Fix incorrect exception when using mode="x" for netCDF files
  Add `validate_nc` command to imaspy CLI
@olivhoenen
Copy link
Collaborator Author

@maarten-ic
Copy link
Collaborator

Looks good!

Some small things people may run into:

  1. pytest imas --mini --ascii (on the installing page) will fail when people don't have imas-core installed. Would be good to add a note in the text about this.
  2. The changelog for v1.1 mentions that imas-core can be installed with pip install 'imas[imas-core] @ git+ssh://git@github.com/iterorganization/imas-core.git'. I don't have access to this git repository but expect that it doesn't work -- even when you do have access to the repository: the pip command tries to install a package called imas with extra dependencies imas-core.
  3. The docs have carefully removed almost any reference to IMASPy. Maybe we could be more explicit about the rename somewhere, so that https://imas-python.readthedocs.io/en/latest/ pops up in the search results when Googling (or Bing-ing, or DuckDuckGo-ing) "imaspy"?
  4. 5-minute introduction starts with printing the version, which is reported as 1.0.0 in the docs. Could we update that to 2.0.0?
  5. Should the 5-minute introduction be updated to use DBEntry URIs, and show an example for netCDF files?

@prasad-sawantdesai
Copy link
Collaborator

Just enabled ITER CI for IMAS-Python GitHub Repo. I found following warnings in sphinx doc generation

What's new in IMAS-Python 1.2.0
--------------------------
/opt/bamboo-agent-home/xml-data/build-dir/IC-IG4-BDD/docs/source/changelog.rst:12: WARNING: py:func reference target not found: imaspy.DBEntry.get_sample
/opt/bamboo-agent-home/xml-data/build-dir/IC-IG4-BDD/docs/source/generated/imas.backends.imas_core.al_context.LazyALArrayStructChildContext.rst:30:<autosummary>:1: WARNING: py:obj reference target not found: imas.backends.imas_core.al_context.LazyALArrayStructChildContext.get_child
/opt/bamboo-agent-home/xml-data/build-dir/IC-IG4-BDD/docs/source/generated/imas.backends.imas_core.al_context.LazyALArrayStructContext.rst:31:<autosummary>:1: WARNING: py:obj reference target not found: imas.backends.imas_core.al_context.LazyALArrayStructContext.get_child
/opt/bamboo-agent-home/xml-data/build-dir/IC-IG4-BDD/docs/source/generated/imas.backends.imas_core.al_context.LazyALContext.rst:30:<autosummary>:1: WARNING: py:obj reference target not found: imas.backends.imas_core.al_context.LazyALContext.get_child
/opt/bamboo-agent-home/xml-data/build-dir/IC-IG4-BDD/docs/source/generated/imas.backends.netcdf.ids2nc.IDS2NC.rst:33:<autosummary>:1: WARNING: py:obj reference target not found: imas.backends.netcdf.ids2nc.IDS2NC.tensorize
/opt/bamboo-agent-home/xml-data/build-dir/IC-IG4-BDD/docs/source/generated/imas.backends.netcdf.ids_tensorizer.IDSTensorizer.rst:29:<autosummary>:1: WARNING: py:obj reference target not found: imas.backends.netcdf.ids_tensorizer.IDSTensorizer.tensorize
/opt/bamboo-agent-home/xml-data/build-dir/IC-IG4-BDD/docs/source/generated/imas.backends.netcdf.nc2ids.LazyArrayStructContext.rst:22:<autosummary>:1: WARNING: py:obj reference target not found: imas.backends.netcdf.nc2ids.LazyArrayStructContext.get_child
/opt/bamboo-agent-home/xml-data/build-dir/IC-IG4-BDD/docs/source/generated/imas.backends.netcdf.nc2ids.LazyArrayStructContext.rst:22:<autosummary>:1: WARNING: py:obj reference target not found: imas.backends.netcdf.nc2ids.LazyArrayStructContext.get_context
/opt/bamboo-agent-home/xml-data/build-dir/IC-IG4-BDD/docs/source/generated/imas.backends.netcdf.nc2ids.LazyArrayStructContext.rst:22:<autosummary>:1: WARNING: py:obj reference target not found: imas.backends.netcdf.nc2ids.LazyArrayStructContext.iterate_to_index
/opt/bamboo-agent-home/xml-data/build-dir/IC-IG4-BDD/docs/source/generated/imas.backends.netcdf.nc2ids.LazyContext.rst:20:<autosummary>:1: WARNING: py:obj reference target not found: imas.backends.netcdf.nc2ids.LazyContext.get_child
make: *** [Makefile:23: html] Error 1

@prasad-sawantdesai
Copy link
Collaborator

---> ensure all tests pass on bamboo (w.r.t imas-core) passed
https://ci.iter.org/browse/IC-IG4-TWA5-4

@prasad-sawantdesai
Copy link
Collaborator

----> check if documentation builds successfully (i.e. without errors/warnings)
https://github.com/iterorganization/IMAS-Python/actions/runs/13924507015

@prasad-sawantdesai
Copy link
Collaborator

------> check if version of built package is set correctly

Creating distribution package 
(myenv) [sawantp1@sdcc-login02 dist]$ ll
total 37216
-rw-r--r--. 1 sawantp1 sawantp1 29372938 Mar 18 15:43 imas_python-1.2.1.dev94-py3-none-any.whl
-rw-r--r--. 1 sawantp1 sawantp1 29720207 Mar 18 15:42 imas_python-1.2.1.dev94.tar.gz


With Tarball
(myenv) [sawantp1@sdcc-login02 IMAS-Python-release-2.0.0]$ python
Python 3.11.5 (main, Feb  9 2024, 19:54:29) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import imas
15:55:17 CRITICAL Could not import 'imas_core': No module named 'imas_core'. Some functionality is not available. @imas_interface.py:34
>>> imas.__version__
'1.2.1.dev94'
>>> 

@olivhoenen
Copy link
Collaborator Author

Looks good!

Some small things people may run into:

  1. pytest imas --mini --ascii (on the installing page) will fail when people don't have imas-core installed. Would be good to add a note in the text about this.
  2. The changelog for v1.1 mentions that imas-core can be installed with pip install 'imas[imas-core] @ git+ssh://git@github.com/iterorganization/imas-core.git'. I don't have access to this git repository but expect that it doesn't work -- even when you do have access to the repository: the pip command tries to install a package called imas with extra dependencies imas-core.
  3. The docs have carefully removed almost any reference to IMASPy. Maybe we could be more explicit about the rename somewhere, so that https://imas-python.readthedocs.io/en/latest/ pops up in the search results when Googling (or Bing-ing, or DuckDuckGo-ing) "imaspy"?
  4. 5-minute introduction starts with printing the version, which is reported as 1.0.0 in the docs. Could we update that to 2.0.0?
  5. Should the 5-minute introduction be updated to use DBEntry URIs, and show an example for netCDF files?

I'm updating the 5 min intro, few other stuff to modify w.r.t DD4.
By the way @maarten-ic, the behavior for this

>>> core_profiles.time = 1-1j
TypeError: can't convert complex to float

now complains about scalar to array conversion (while I could have assign [1-1j])

>>> core_profiles.time = 1-1j
19:15:10 INFO     Assigning incorrect type 'complex128' to <IDSNumericArray (IDS:core_profiles, time, FLT_1D)>
ValueError: Trying to assign a 0D value to <IDSNumericArray (IDS:core_profiles, time, FLT_1D)>

--> expected?

@maarten-ic
Copy link
Collaborator

I'm updating the 5 min intro, few other stuff to modify w.r.t DD4. By the way @maarten-ic, the behavior for this

>>> core_profiles.time = 1-1j
TypeError: can't convert complex to float

now complains about scalar to array conversion (while I could have assign [1-1j])

>>> core_profiles.time = 1-1j
19:15:10 INFO     Assigning incorrect type 'complex128' to <IDSNumericArray (IDS:core_profiles, time, FLT_1D)>
ValueError: Trying to assign a 0D value to <IDSNumericArray (IDS:core_profiles, time, FLT_1D)>

--> expected?

Mmm, yes, that was changed a while ago indeed. IMAS-Python prints an INFO statement and numpy does give a warning (once) when assigning a complex array to a FLT_1D:

>>> cp.time = [1-1j]
08:26:46 INFO     Assigning incorrect type 'complex128' to <IDSNumericArray (IDS:core_profiles, time, empty FLT_1D)>, attempting automatic conversion. @ids_primitive.py:483
/home/maarten/projects/iter-python/imaspy_12/imaspy/ids_primitive.py:484: ComplexWarning: Casting complex values to real discards the imaginary part
  value = np.asarray(
>>> cp.time
<IDSNumericArray (IDS:core_profiles, time, FLT_1D)>
numpy.ndarray([1.])
>>> cp.time = [1-1j]
08:27:03 INFO     Assigning incorrect type 'complex128' to <IDSNumericArray (IDS:core_profiles, time, FLT_1D)>
numpy.ndarray([1.]), attempting automatic conversion. @ids_primitive.py:483

I think this behavior is fine.

Copy link
Collaborator

@maarten-ic maarten-ic left a comment

Choose a reason for hiding this comment

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

One minor comment, nothing else from my side at this moment.

Co-authored-by: Maarten Sebregts <110895564+maarten-ic@users.noreply.github.com>
@olivhoenen olivhoenen merged commit 27d7cd6 into main Mar 19, 2025
30 checks passed
@olivhoenen olivhoenen deleted the release/2.0.0 branch March 21, 2025 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants