Skip to content

yt 4.2.0

Compare
Choose a tag to compare
@neutrinoceros neutrinoceros released this 27 May 12:51
· 780 commits to main since this release
3c12d55

Summary

This is the second feature release in the yt 4.x series. It also comes with some important bug fixes.
Some deprecations are now expired, some minor backward incompatibilities are expected. Anything broken on purpose in this version should correspond to a warning in yt 4.1.x, anything beyond that should be considered a regression; please report any unexpected breaking change.

Python 3.8 to 3.11 is supported.

How to upgrade

To upgrade from PyPI, run

python -m pip install --upgrade yt

or, with conda

conda update --channel conda-forge yt

🌟 Highlights

  • Multiple improvements (detection, validation, uage) for EWAH files (#4307, #4426)
  • yt can now be installed with frontend specific optional dependencies with pip (#4272)
  • Plugin frontends can now seamlessly hook into yt.load() (#4285)
  • Off-axis projections are now supported for non-SPH particle (#4440)

🐛 Bug fixes

#4235 Migrate away from broken optional dependency (pyregion -> regions), by @neutrinoceros (issue #4234)
#4268 Implement lazy-loading (on-demand-import) for regions, by @neutrinoceros (issue #3320 by @cphyc)
#4316 Check for _unit_system_name in save_as_dataset, by @chrishavlin (issue #4315)
#4328 cell_widths validation for load_uniform_grid, by @chrishavlin
#4361 + #4422 Handle deprecation warnings from numpy 1.25, by @neutrinoceros
#4378 Fix typo in vector operations and enable plot modifications for spherical geometry, by @jisuoqing
#4381 Avoid setting basename attribute in EnzoDatasetInMemory._parse_parameter_file, by @chrishavlin
#4387 Add meter and millimeter to smallest units, by @matthewturk
#4404 Make sure find_lowest_subclasses doesn't add extra classes, by @yut23
#4417 Fix inconsistent units labelling between plot axis and colorbar, by @neutrinoceros (issue #4416)
#4426 More robust detection and checking of EWAH files, by @jzuhone
#4429 Fix confusing error message when yt fails to locate data, by @neutrinoceros
#4431 Allow smoothing of derived SPH fields onto covering grids, by @jzuhone
#4438 Raise exception when a file does not exist, by @cphyc (issue #4436)
#4443 Fix a bug in Dataset.print_stats() where length units would be printed twice, by @neutrinoceros

🚀 New features

#4175 Improvements to field_to_include specifications in create_firefly_object, by @mtryan83 (issue #4174)
#4198 + #4249 Automatically find EWAH files with increased index_order2, by @jzuhone (issue #3487 by @chummels)
#4205 Add upward directory lookup for local configuration file, by @neutrinoceros (issue #3953)
#4222 Two new features for writing FITS images, by @jzuhone
#4272 Add support for installing yt with cherry-picked, frontend specific optional dependencies with pip, by @neutrinoceros (issue #4272)
#4285 Automatically load external frontends in yt.load(), by @Xarthisius
#4307 Allow to store multiple bitmap indices in the ewah-sidecar, by @Xarthisius
#4343 Add reusable matplotlib stylesheet, by @neutrinoceros (issue #4342)
#4363 Add basename for loaders, by @jisuoqing
#4397 Allow hint keyword for yt.load to select superclasses, by @yut23
#4410 Export standard deviation to pandas DataFrames and AstroPy QTables, by @jzuhone
#4446 Whitelist the SPH star_formation_rate field, by @jzuhone
#4440 Off-axis (non-SPH) particle projections, by @jzuhone

experimental features

♻️ Optimisations and refactors

#4183 Ensure SpectralCubeCoordinateHandler is testable and tested, by @neutrinoceros (issue #4180)
#4195 Cleanup unused import statements in Cython files, by @neutrinoceros
#4196 Remove useless variables in Cython code, by @cphyc
#4200 Fix a missing type declaration in Cython file , by @neutrinoceros
#4210 Simplify/clarify inheritance hierarchy for yt.data_objects.unions.Union, by @neutrinoceros
#4226 Don't drop ImportError tracebacks for lazily-loaded optional dependencies, by @neutrinoceros (issue #4224)
#4242 Upgrade flake8-bugbear and fix newly detected errors, by @neutrinoceros
#4244 and #4309 Use an enum to represent dataset geometries, by @neutrinoceros
#4265 Delay expensive imports, by @neutrinoceros
#4292 and #4325 Migrate from pkg_resources to importlib.resources, by @neutrinoceros (issue #4287)
#4294 Minor refactor for PhasePlot._setup_plots, by @neutrinoceros
#4411 Rewrite find_lowest_subclasses to better match its intent, by @yut23
#4435 Simplify base CoordinateHandler implementation, by @neutrinoceros

Typing

#4227 Typing improvements using latest mypy (0.991), by @neutrinoceros
#4229 Add static typing to Dataset._get_field_info_helper, by @neutrinoceros
#4251 Add missing type hints, by @neutrinoceros
#4260 Use FieldKey type aliases instead of Tuple[str, str], by @neutrinoceros
#4277 Fix mypy warnings about unchecked hints, by @neutrinoceros

Tests

#4255 Add some missing test for stream grids with callables, by @chrishavlin
#4266 Add missing @requires_module("h5py") decorators, by @neutrinoceros
#4267 Uniformize YTException class hierarchy, by @neutrinoceros
#4310 Bump CI from Python 3.10 to 3.11, by @neutrinoceros
#4336 Enable dependabot autoupdates for GitHub workflows, by @neutrinoceros (issue #4333)
#4354 Minor updates to answer tests infra, by @Xarthisius

📚 Documentation

#4181 Cleanup calls to private methods _setup_plots in doctests, by @neutrinoceros
#4314 Fix docs typo in load_hdf5_file description, by @chrishavlin
#4332 Load unstructured mesh SlicePlot, by @chrishavlin
#4377 Fix typos, by @neutrinoceros
#4385 Fix example in docs and missing displacement for unstructured mesh, by @matthewturk
#4388 Fix field access in ytdata docs, by @brittonsmith
#4407 A few doc fixes from Sphinx make linkcheck, by @zingale
#4423 Some spelling fixes, by @zingale

🤖 Frontends

Frontend-specific improvements and bug fixes

[Arepo]
#4419 Small Arepo/Gadget enhancements, by @jzuhone

[Boxlib]
#4402 ENH: improve boxlib data type detection, by @yut23

[CHOLLA]
#4389 Avoiding issue for CHOLLA LightRay datasets, by @chummels

[FLASH, GAMER]
#4134 Enable exporting GAMER and FLASH datasets to octrees, by @matthewturk

[Gadget]
#4419 Small Arepo/Gadget enhancements, by @jzuhone

[Gizmo]
#4331 Fix an error when loading a non-cosmological dataset, by @jisuoqing

[MAESTROeX]
#4347 Fixed the detection of how temperature is defined, by @zingale

💣 Deprecations

Expired deprecations and known-breaking changes

#4106 Expire deprecations ended in yt 4.2, by @neutrinoceros

New deprecations

#4177 Deprecate calling yt.load with first argument passed as keyword, by @neutrinoceros
#4210 Deprecate Importing ParticleUnion from yt.data_objects.particle_unions, by @neutrinoceros
#4434 Deprecate numpy.testing reexports in yt.testing, by @neutrinoceros
#4439 Deprecate unnecessary functions in the yt.testing namespace, by @neutrinoceros

🧩 Requirements

  • Python 3.8 or newer is now required
  • numpy >= 1.17.5 or newer is now required
  • matplotlib >= 3.2.0 is now required
  • ewah-bool-utils >= 1.0.2 is now required (see #2711, by @themousepotato)
  • importlib-resources >= 1.3 is now required with Python < 3.9
  • typing-extensions >= 4.1.0 is now required with Python < 3.11
  • other constraints for optional/testing dependencies were lifted (see #4364, #4380, #4344)

Notes for downstream packagers and developers

  • ewah-bool-utils >= 1.0.2 is now required at build time
  • Cython>=0.29.33 is now required at build time. We have made constant progress towards compatibility with the future Cython 3.0 (#4357, #4359, #4365, #4373, #4374, #4375, #4376, #4386, #4390, #4392)
  • packaging metadata was migrated to pyproject.toml (#4271, #4273, #4276)