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

CDFlib >= 1.0.0 may cause problems #3

Open
sapols opened this issue Mar 11, 2024 · 1 comment
Open

CDFlib >= 1.0.0 may cause problems #3

sapols opened this issue Mar 11, 2024 · 1 comment

Comments

@sapols
Copy link
Contributor

sapols commented Mar 11, 2024

CDFlib made a major release 1.0.0 with breaking changes June 2023. It's now up to 1.3.2 as of this writing.

Some PyHC packages didn't yet support the new major release so we temporarily pinned the CDFlib version to 0.4.9.

pySPEDAS was the biggest package requiring <1.0.0.
GeospaceLAB was pinned to 0.6.1 because after that it requires >=1.0.0.

Update Dec 5, 2024:
The CDFlib version is no longer pinned because it no longer causes conflicts. HOWEVER, I'm keeping this open out of an abundance of caution, since it's possible some packages haven't realized v1.0.0+ might break their code. And the backwards compatibility trick commented below could help them (and I don't wanna forget about it).

@sapols
Copy link
Contributor Author

sapols commented Apr 4, 2024

Viresclient found a solution to support cdflib before and after the 1.0 release (see this commit):

    @staticmethod
    def _get_attr_or_key(obj, attr):
        # Used to work around cdflib<1 & >=1 support
        # cdflib>=1 introduces dataclasses in place of some dicts
        if isinstance(obj, dict):
            return obj.get(attr, None)
        else:
            return getattr(obj, attr, None)

This is much nicer than how e.g. GeospaceLAB did it, which was to simply switch from the old syntax to the new (hence issue #4). I think PyHC should recommend other packages that use cdflib do the same:

  • pySPEDAS (>=0.3.9,<1.0.0) -> (now >=1.2.0)
  • PyTplot (any)
  • PyTplot-mpl-temp (<1.0.0) -> (now >=1.2.0)
  • aidapy (any)
  • geospaceLAB (>=0.3.20) -> (now >=1.2.3)
  • solo-epd-loader (any)
  • themisasi (>=0.3.13)
  • viresclient (>=0.3.9)

@sapols sapols changed the title CDFlib pinned to 0.4.9 CDFlib no longer pinned to 0.4.9 Dec 6, 2024
@sapols sapols changed the title CDFlib no longer pinned to 0.4.9 CDFlib >= 1.0.0 may cause problems Dec 6, 2024
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

No branches or pull requests

1 participant