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

Relax concatenation checks for --check_level=relax and --check_level=ignore #2144

Merged
merged 20 commits into from Oct 6, 2023

Conversation

sloosvel
Copy link
Contributor

@sloosvel sloosvel commented Jul 24, 2023

Description

This PR allows to relax the concatenation checks for --check_level=relaxed and --check_level=ignore. Additionally, the concatenation is performed at once with all cubes, instead of in a two-by-two way. The overlaps in the time coordinate are checked before performing the concatenation, but they consider the same cases as the current implementation.

I only tested the concatenation of many files, but I don't know at the top of my head any data with the overlaps that are being considered. So I have not tested with any real dataset. The old tests seem to past though.

Closes (kind of) #2073

Link to documentation: https://esmvaltool--2144.org.readthedocs.build/projects/ESMValCore/en/2144/


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:

@sloosvel sloosvel marked this pull request as draft July 24, 2023 11:11
@codecov
Copy link

codecov bot commented Jul 24, 2023

Codecov Report

Merging #2144 (aa12542) into main (13a444e) will increase coverage by 0.07%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2144      +/-   ##
==========================================
+ Coverage   93.19%   93.26%   +0.07%     
==========================================
  Files         238      238              
  Lines       12826    12833       +7     
==========================================
+ Hits        11953    11969      +16     
+ Misses        873      864       -9     
Files Coverage Ξ”
esmvalcore/dataset.py 100.00% <100.00%> (ΓΈ)
esmvalcore/preprocessor/_io.py 90.53% <100.00%> (+4.09%) ⬆️

@sloosvel sloosvel added this to the v2.10.0 milestone Jul 24, 2023
@sloosvel sloosvel added the preprocessor Related to the preprocessor label Jul 24, 2023
@sloosvel sloosvel marked this pull request as ready for review July 24, 2023 12:51
Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

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

thanks very much @sloosvel - I am a bit confused by this PR but let me have a look at the entire code (in a branch checkout) first, then I'll post me comments 🍺

esmvalcore/preprocessor/_io.py Show resolved Hide resolved
@valeriupredoi
Copy link
Contributor

aye, took a look at the entire _io.py and unconfused myself, very nice work! Could you maybe add a reference to the iris documentation where those kwargs are explained? also pls add a TODO keep track of whatever iris add as tunable kwargs. One more point - creation_date may be a useful cube attribute for provenance/version tracking, do we have to remove it? 🍺

@bouweandela
Copy link
Member

One more point - creation_date may be a useful cube attribute for provenance/version tracking, do we have to remove it?

This is recorded in our provenance here:

def _initialize_entity(self):
"""Initialize the entity representing the file."""
if self.attributes is None:
self.attributes = {}
with Dataset(self.filename, 'r') as dataset:
for attr in dataset.ncattrs():
self.attributes[attr] = dataset.getncattr(attr)

The attribute is removed from the cubes because it becomes invalid when we process the data.

Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

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

revising my stale review, cheers, Saskia! 🍺

@bouweandela bouweandela merged commit 469fd09 into main Oct 6, 2023
4 checks passed
@bouweandela bouweandela deleted the dev_relax_concat branch October 6, 2023 07:05
@zklaus zklaus added cmor Related to the CMOR standard and removed preprocessor Related to the preprocessor labels Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmor Related to the CMOR standard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants