-
Notifications
You must be signed in to change notification settings - Fork 33
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
PrePARE missing _FillValue exit #367
Comments
As you know, PrePARE is tailored to examine files that are to be published on ESGF with metadata conforming to the CMIP6 specifications. For CMIP6 the variable attributes missing_value and FillValue are required, but I'm surprised that PrePARE checks that they are there, but if it does this is desirable for CMIP6. If you look at the code, let us know what you find. |
Just to be clear: I think it would be good for data providers - who want to publish data via ESGF - to know all attributes that are missing in the files instead of only I saw that the code causing this error was changed since commit |
Ok after an update to the most recent version the error is gone but instead I have:
Any ideas? Also, it is no longer mentioned in the output that the "_FillValue" is missing. |
And when I include the missing file from the github repo:
which corresponds to the previous error. |
@wachsylon concerning #367 (comment) this is really issue #373 |
The request is that PrePARE should not error exit on encountering the first error. Rather it should continue on and complete all its checks. This will help users to more quickly modify their output files to be compliant with the specs. |
@taylor13 @doutriaux1 Getting back to this, it looks like it tries to get the values for the attributes Lines 536 to 542 in 2e9f6b2
Why do we need _FillValue and units from the file if we are checking them against the attributes in the table?
|
@doutriaux1 The cmip6_cv.setup_variable line is setting up a variable that has attribute values from the table. However, it is getting edit: Lines 561 to 636 in 2e9f6b2
So when it's validating the file's _FillValue and missing_value values it is actually validating those attibutes againsts the file's _FillValue value.
|
As we discussed, the suggestion is to either avoid passing any information about the file's units and _FillValue as arguments of cmip6_cv.setup_variable (i.e., either remove the arguments self.dictVar['units'], self.dictVar['_FillValue'], or set them to some value serving as a flag that tells cmip6_cv.setup_variable to skip any code where these arguments are currently required). There should be no need to read from the file _FillValue and units prior to checking them against the information in the table. |
@taylor13 The variable cmor/TestTables/CMIP6_Ofx.json Lines 35 to 54 in 2e9f6b2
I thought it would use -999 as its missing value. cmor/TestTables/CMIP6_Ofx.json Line 9 in 2e9f6b2
However, when I got a NetCDF file for basin from ESGF I found out that it was using 0 as its missing_value and _FillValue .
Should we treat |
"0" should definitely not be declared as I don't think this should be a special case (other than it is declared integer rather than float). |
I submitted a pull request that will make PrePARE get the units and missing values from the table instead of the NetCDF file. I also added a parameter for the missing integer value when setting up the variable. Alternatively, we could just get rid of the units and missing value parameters from the variable setting functions since cmor_CV_variable can get the values directly from the table. I don't think anything other than PrePARE uses these functions. Lines 2292 to 2295 in 84fd521
|
I'll try to check this tomorrow. |
Hi,
I have data files with variables which do not include _FillValue and _MissingValue attributes. This causes the following error wihtin PrePARE:
However, I would like to have an overview about all missing or wrong variable attributes so PrePARE should not exit at this point without checking the other ones. I installed it via conda.
Is there already an option to ignore that error or is it a bug?
I have not looked into the src of PrePARE yet.
Best regards,
Fabi
The text was updated successfully, but these errors were encountered: