Skip to content

Conversation

@gonzaponte
Copy link
Collaborator

In this PR, I revisit the file compression in IC. The main point was that this feature relied on the same default value being used everywhere (namely "ZLIB4"). While addressing this, I noticed that we didn't have any check for compression and that we were doing it inconsistently. Furthermore, the compression options were redundant, as the compression library and level can be set at file opening, and the data stored inherits this configuration.

There are two significant changes implemented here:

  • Writers will no longer compress something with a default value that magically happened to be the same everywhere. As a consequence, cities are now fully responsible for file compression.
  • By default, the compression configuration will be set only at file opening. This, however, can be overridden for each individual writer explicitly.

These changes won't have a major impact on users or developers. Nonetheless, developers writing new cities will have to be aware of this.

@gonzaponte gonzaponte requested a review from jmbenlloch May 24, 2022 09:39
Copy link
Contributor

@jmbenlloch jmbenlloch left a comment

Choose a reason for hiding this comment

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

Good job! The code is more consistent now and less prone to errors. I like your test_city_output_file_is_compressed test. Approved!

This test ensures all cities produce an output file that is fully
compressed.
We missed it when the city was introduced
This allows data compression
The scope of this change will be clear in the following commits
This doesn't mean that the tables will not be compressed. Instead, the
compression configuration will fall back to a default value coming
from the overall file compression. However, if a non-None value is
passed, this will force that specific compression for the
corresponding nodes. This still allows for the (somewhat rare) cases
when an user wants to use these writers outside of a city.

From now on, *cities are responsible for setting the compression
configuration on file opening*
This avoids confussion since the compression for each node is now
inherited from the overall file compression.
@MiryamMV MiryamMV merged commit ebaa7fe into next-exp:master Jun 29, 2022
@gonzaponte gonzaponte deleted the compression branch July 18, 2022 10:25
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.

3 participants