Skip to content

Commit

Permalink
Merge pull request #292 from observingClouds/update_bitinformationjl
Browse files Browse the repository at this point in the history
update bitinformation.jl version to 0.6.3
  • Loading branch information
observingClouds authored Aug 14, 2024
2 parents 7ee5d9c + 59a096c commit 8d820af
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CHANGELOG
X.X.X (unreleased)
------------------

* Update BitInformation.jl version to v0.6.2 (:pr:`291`) `Hauke Schulz`_
* Update BitInformation.jl version to v0.6.3 (:pr:`292`) `Hauke Schulz`_
* Improve test/docs environment separation (:pr:`275`, :issue:`267`) `Aryan Bakliwal`_.
* Set default masked value to None for integers (:pr:`289`) `Hauke Schulz`_.
* Add basic filter to remove artificial information from bitinformation (:pr:`280`, :issue:`209`) `Ishaan Jain`_.
Expand Down
6 changes: 5 additions & 1 deletion tests/test_get_bitinformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@ def test_get_bitinformation_masked_value(implementation="julia"):
bitinfo_no_mask_None = xb.get_bitinformation(
ds, dim="x", masked_value=None, implementation=implementation
)
bitinfo_fillna = xb.get_bitinformation(
ds.fillna(-999), dim="x", masked_value=-999.0, implementation=implementation
)
assert_identical(bitinfo_no_mask, bitinfo_no_mask_None)
assert_different(bitinfo, bitinfo_no_mask)
assert_identical(bitinfo, bitinfo_no_mask)
assert_different(bitinfo, bitinfo_fillna)


@pytest.mark.parametrize("implementation", ["julia", "python"])
Expand Down
2 changes: 1 addition & 1 deletion xbitinfo/julia_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def _add_to_julia_project(Main, io_arg):
Main.bitinformation_spec = Main.PackageSpec(
name="BitInformation",
url="https://github.com/milankl/BitInformation.jl",
rev="v0.6.2",
rev="v0.6.3",
)
Main.statsbase_spec = Main.PackageSpec(
name="StatsBase",
Expand Down
10 changes: 5 additions & 5 deletions xbitinfo/xbitinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def get_bitinformation( # noqa: C901
* bitfloat64 (bitfloat64) <U3 768B '±' 'e1' 'e2' 'e3' ... 'm50' 'm51' 'm52'
dim <U3 12B 'lon'
Data variables:
air (bitfloat64) float64 512B 0.0 0.0 0.0 ... 0.002847 0.0 0.0005092
air (bitfloat64) float64 512B 0.0 0.0 0.0 ... 0.002848 0.0 0.0005048
Attributes:
xbitinfo_description: bitinformation calculated by xbitinfo.get_bit...
python_repository: https://github.com/observingClouds/xbitinfo
Expand All @@ -173,7 +173,7 @@ def get_bitinformation( # noqa: C901
* bitfloat64 (bitfloat64) <U3 768B '±' 'e1' 'e2' 'e3' ... 'm50' 'm51' 'm52'
* dim (dim) <U4 48B 'lat' 'lon' 'time'
Data variables:
air (dim, bitfloat64) float64 2kB 0.0 0.0 0.0 ... 0.0 0.0004498
air (dim, bitfloat64) float64 2kB 0.0 0.0 0.0 ... 0.0 0.0004506
Attributes:
xbitinfo_description: bitinformation calculated by xbitinfo.get_bit...
python_repository: https://github.com/observingClouds/xbitinfo
Expand Down Expand Up @@ -446,7 +446,7 @@ def get_cdf_without_artificial_information(
* dim (dim) <U4 48B 'lat' 'lon' 'time'
* inflevel (inflevel) float64 8B 0.99
Data variables:
air (dim, inflevel) int64 24B 5 6 6
air (dim, inflevel) int64 24B 5 7 6
"""

# Extract coordinates from the 'info_per_bit' dataset.
Expand Down Expand Up @@ -540,7 +540,7 @@ def get_keepbits(info_per_bit, inflevel=0.99, information_filter=None, **kwargs)
dim <U3 12B 'lon'
* inflevel (inflevel) float64 8B 0.99
Data variables:
air (inflevel) int64 8B 6
air (inflevel) int64 8B 7
>>> xb.get_keepbits(info_per_bit, inflevel=0.99999999)
<xarray.Dataset> Size: 28B
Dimensions: (inflevel: 1)
Expand All @@ -565,7 +565,7 @@ def get_keepbits(info_per_bit, inflevel=0.99, information_filter=None, **kwargs)
* dim (dim) <U4 48B 'lat' 'lon' 'time'
* inflevel (inflevel) float64 8B 0.99
Data variables:
air (dim, inflevel) int64 24B 5 6 6
air (dim, inflevel) int64 24B 5 7 6
"""
if not isinstance(inflevel, list):
inflevel = [inflevel]
Expand Down

0 comments on commit 8d820af

Please sign in to comment.