Closed brendanjmeade closed 2 years ago
I got exactly the same error when running locally. When you tested locally, how were you running the code? To exactly replicate the CI system, you need to run pytest celeri.py celeri_closure.py
(see this file for a definition of exactly what the CI runs): https://github.com/brendanjmeade/celeri/blob/37c8f8cd1aed1fcd412fccdcc86bfd44da1a1130/.github/workflows/test.yml#L28
I just created https://github.com/brendanjmeade/celeri/pull/41 to fix the issue!
Running pytest locally will help me a lot. Thanks a lot not only for the fix but more importantly for your patience in teaching me how to listen and learn from the testing results!
Of course! Happy to help.
The "short test summary info" is often the place to start:
FAILED celeri.py::test_global_closure - KeyError: 'smoothing_weight'
tells you that the test that failed was the test_global_closure
test in celeri.py
.
You can run just a specific test using that same syntax:
pytest celeri.py::test_global_closure
That helps a lot. Good to be learning!
I added a few lines (118, 119, and 120) to celeri to add a few more fields to the dictionary meshes after it reads in data from the .json file that describes the meshes. I get the error below reporting a failure related to the assignement of one of these variables...but...the entire thing runs just fine locally on my laptop? I'm pretty confused. Thoughts @tbenthompson?
=================================== FAILURES =================================== _____ test_global_closure __ celeri.py:2184: in test_global_closure command, segment, block, meshes, station, mogi, sar = celeri.read_data( celeri.py:118: in read_data meshes[i].smoothing_weight = mesh_param[i]["smoothing_weight"] E KeyError: 'smoothing_weight' =========================== short test summary info ============================ FAILED celeri.py::test_global_closure - KeyError: 'smoothing_weight' ========================= 1 failed, 2 passed in 17.71s =========================