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

Add tests for grib idx & reinflate #528

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

emfdavid
Copy link
Contributor

@emfdavid emfdavid commented Nov 19, 2024

Add chunky test files and copy over unit test approach.

Builds on #523

TODO:

  • Get tests working by editing fixtures/code
  • Modify to use pytest instead of unittest
  • Squash commits to avoid extra git blobs

@martindurant
Copy link
Member

Well that's a lot .... :)

@emfdavid
Copy link
Contributor Author

Well that's a lot .... :)

All part of my plan to become top contributor...

@emfdavid emfdavid changed the title Add tests for discussion Add tests for grib idx & reinflate Nov 27, 2024
@emfdavid emfdavid force-pushed the grib_idx_tests branch 2 times, most recently from 65ff274 to 261ee2f Compare December 16, 2024 18:57
@@ -284,6 +291,10 @@ def test_build_idx_grib_mapping(self):
)
expected = pd.read_parquet(kindex_test_path)

expected = expected.assign(
step=lambda x: x.step.astype("timedelta64[ns]")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@martindurant These errors in the CI system are really strange... These typically only happen when using an old version of numpy/pandas that has a different default time type.
The last one, the sync error... that seems like maybe I need to convert from unittest subtest to pytest?

@martindurant
Copy link
Member

It claims to have numpy 2.2.0, but there is this:

RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 16 from C header, got 96 from PyObject

which suggests maybe there is a conda-forge/defaults/pip crossover? We do have nodefaults in the environment spec.

@emfdavid
Copy link
Contributor Author

It claims to have numpy 2.2.0, but there is this:

RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 16 from C header, got 96 from PyObject

which suggests maybe there is a conda-forge/defaults/pip crossover? We do have nodefaults in the environment spec.

Welp - I dumped as much version info as I can think to and I don't see any smoking gun
https://github.com/fsspec/kerchunk/actions/runs/12385105383/job/34570789000?pr=528#step:5:532

@emfdavid
Copy link
Contributor Author

Okay - I can repro locally now after installing anaconda python.
I will debug tomorrow.

@emfdavid
Copy link
Contributor Author

Okay - fixed the dtype on the step column.
It is an issue with reading the parquet files - I had to set engine='fastparquet' on the pd.read_parquet calls in my test.
Otherwise the timedelta64 step column does not decode properly.
This only happens in the anaconda environment. I can't repro the issue when I use a python 3.12 virtual env.

I am not sure what the remaining sync error is. I can't reproduce that one locally yet. Could it be a version skew problem?

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.

2 participants