Conversation
Codecov Report
@@ Coverage Diff @@
## main #1216 +/- ##
==========================================
+ Coverage 85.51% 85.53% +0.01%
==========================================
Files 188 188
Lines 9136 9148 +12
==========================================
+ Hits 7813 7825 +12
Misses 1323 1323
Continue to review full report at Codecov.
|
|
The issue with this approach is that there are experiments, where there are two or more fx files for the same variable and it is impossible to determine a generic right order, e.g. here. I think #1159 (comment) is relevant. In other words, just specify the correct table in the recipe. |
zklaus
left a comment
There was a problem hiding this comment.
I don't think any generic ordering can meaningfully resolve existing ambiguity in the table selection.
|
I do like the documentation improvements. Let's work that into 2.4.0. |
I agree, that's why I added this note to the documentation: .. note::
Some fx variables exist in more than one table (e.g., ``volcello`` exists in
CMIP6's ``Ofx`` and ``Omon`` table or ``sftgif`` exists in CMIP6's ``fx``
and ``IyrAnt`` table). If a specific table is desired, this needs to be
specified by ``mip``, otherwise the table is selected based on the
alphabetical order and data availability.Do you want the tool to fail if there's is ambiguity? Or issue a warning? I still thinks this should go into 2.3.1 since this merely fixes a bug that was introduced in 2.3.0. |
|
I think the tool should fail if there is ambiguity. As for the bug, are you referring to #1159? If so, in my view, that doesn't reflect the introduction of a new bug, but the uncovering of an existing bug in the test, namely the ambiguity. The solution seems clear: specify the correct table in the recipe used in the test. I am not sure why @sloosvel's comment there went unanswered. If you mean another bug, I am sorry I missed it. In that case, could you point me to the right issue, please? |
|
The tests were designed for the pre-#999 situation and did not fail there. This old implementation did only check tables that included #1169 "solved" this by disabling the tests. I don't think that's the way to go. This PR fixes the tests by introducing a machine-independent ordering for the tables. I agree with you that in case of ambiguity the tool should fail, but this would be a new feature and should go into v2.4 (I can open another PR for that). |
|
It seems we agree that the bug is in the test. We also agree that disabling the test is not really the right way to address this. But there seems to be a clear solution: fix the test. Why would we want to change the behavior of the tool to work around a buggy test? |
|
|
I think the changes make the documentation much better. I agree that that |
|
@sloosvel - @zklaus provides an example of exactly that - |
Almost right: |
|
All right, I will alter the code so that it raises an error if multiple |
|
Alright, I am not against putting this in 2.3.1, but it still needs a bit of work (I spotted some things in the documentation at least and I think we don't have any formal review yet), so it might come down to a question of timing. |
|
Alright, now the tool raises an error if an fx variable is found in multiple tables. I also adapted the documentation accordingly. |
valeriupredoi
left a comment
There was a problem hiding this comment.
excellent work, cheers @schlunma 🍺 One nag for me, I'd change that from a Note to a Warning 👍
Co-authored-by: Valeriu Predoi <valeriu.predoi@gmail.com>
zklaus
left a comment
There was a problem hiding this comment.
Sorry, only made it just to the actual code; have to continue later. Anyway, I think the most important comment is the last one.
zklaus
left a comment
There was a problem hiding this comment.
Sorry if something is very weird; I had some trouble with the github web interface.
|
I don't know why the tests are failing, I though these errors were fixed by #1173? |
|
pls merge |
|
After the merge of |
|
yes, @bouweandela is famous for causing SegFaults 🤣 It's a SegFault, Manu, am rerunning it just for you 😁 |
|
The error didn't disappear after 3 restarts, so I guess there is something wrong here... Tests run fine locally. |
|
hang on, lemme investigate 🔍 |
|
running tests locally I am getting this: and no SegFault after 2 runs, after updating to Python 3.9.6 too |
|
Oh, that's again related to the machine-dependent ordering. Lemme change that real quick. |
|
you know what? That recursion depth error might have given me a massive clue why we get all those SegFaults anyway |
you not running Ubuntu too on your machine? |
|
Was doing the tests on mistral which runs on Red Hat Enterprise Linux |
|
weird coz I think that Circle runs on CentOS - ah yes, not weird, I am silly, they're the same curry |
|
Thanks so much V., that seems to have done the trick! 🎉 @zklaus Any further comments from your side? I hope I addressed them all. |
|
so funny - now the tests pass fine and no more SegFault - I am going to get to the bottom of those SegFaults so help me Lord Vader! 😁 |
|
Haha, I hope you will! |
|
Nice work, @schlunma ! 🍻 |
* Fixed tests related to fx file retrieval * Raise error when fx variable is present in multiple tables * Update doc/recipe/preprocessor.rst Co-authored-by: Valeriu Predoi <valeriu.predoi@gmail.com> * Updated documentation on fx variables * Used :ref: to link area_statistics and volume_statistics * Optimized fx doc * Only raise ambiguity error if fx files are found in mutiple tables * Fixed machine-dependent error-message Co-authored-by: Valeriu Predoi <valeriu.predoi@gmail.com>
This PR fixes the automatic retrieval of fx files when no
mipis specified.I agree with @sloosvel that a predefined order for the mip tables is not useful due to the many different project tables. Therefore I just implemented an alphabetic ordering, i.e., the first
mipthat has data is automatically selected. To bypass this, the user has to define a specificmipin the recipe. I added a paragraph to the documentation that describes this process.This should go into 2.3.1 since this fixes a bug that (1) lets the test fails and (2) might lead to the tool wrongly complaining about missing data. #1169 only disabled the tests and didn't actually fix the bug.
Closes #1159.
Link to documentation: https://esmvaltool--1216.org.readthedocs.build/projects/ESMValCore/en/1216/recipe/preprocessor.html#fx-variables-as-cell-measures-or-ancillary-variables
Before you get started
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.
To help with the number pull requests: