Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README-dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -454,4 +454,4 @@ To build the api docs using autodocs

Copyright
^^^^^^^^^
Copyright (c) 2025 Mira Geoscience Ltd.
Copyright (c) 2020-2026 Mira Geoscience Ltd.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Third Party Software notices and/or additional terms and conditions are located

Copyright
^^^^^^^^^
Copyright (c) 2025 Mira Geoscience Ltd.
Copyright (c) 2020-2026 Mira Geoscience Ltd.


Citing geoh5py
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/blob_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/boolean_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/color_map.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/colour.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/data_association_enum.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/data_type.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/data_unit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/datetime_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/filename_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/float_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/geometric_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/integer_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/numeric_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/reference_value_map.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/referenced_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/text_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/data/unknown_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
21 changes: 15 additions & 6 deletions geoh5py/data/visual_parameters.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand All @@ -21,6 +21,7 @@
from __future__ import annotations

import xml.etree.ElementTree as ET
from collections.abc import Sequence

import numpy as np

Expand Down Expand Up @@ -101,16 +102,24 @@ def colour(self) -> None | list:

c_string = (int(element.text)).to_bytes(4, byteorder="little").hex()

return [int(c_string[i : i + 2], 16) for i in range(0, 8, 2)][:3]
# Flip the colour order from BGR to RGB
return [int(c_string[i : i + 2], 16) for i in range(0, 8, 2)][2::-1]

@colour.setter
def colour(self, rgb: list | tuple | np.ndarray):
def colour(self, rgb: Sequence):
if (
not isinstance(rgb, (list, tuple, np.ndarray))
or len(rgb) != 3
not isinstance(rgb, Sequence)
or len(rgb) not in [3, 4]
or not all(isinstance(val, int) for val in rgb)
):
raise TypeError("Input 'colour' values must be a list of 3 integers.")
raise TypeError("Input 'colour' values must be a list of 3 or 4 integers.")

rgb = list(rgb)
if len(rgb) == 3:
rgb += [255]

# Flip the colour order from RGB to BGR
rgb = rgb[2::-1] + [rgb[3]]

byte_string = "".join(f"{val:02x}" for val in rgb)
byte_string.join(f"{255:02x}") # alpha value
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The result of str.join() is not being used. Line 125 calls byte_string.join() but doesn't assign or use the return value. This line appears to be attempting to append an alpha value, but str.join() returns a new string rather than modifying the original. This is likely a bug as the alpha value is already included in the byte_string at line 124 (the rgb list already contains 4 elements including the alpha). If the intent was to append an alpha value, this line should be removed since it's already handled at line 119. If there was a different intent, the code should be corrected to use the return value.

Suggested change
byte_string.join(f"{255:02x}") # alpha value

Copilot uses AI. Check for mistakes.
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/container.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/custom.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/drillhole.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/giftools.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/group_type.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/integrator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/interpretation_section.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/maps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/notype.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/property_group.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/property_group_table.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/property_group_type.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoh5py/groups/root.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2020-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. '
# '
Expand Down
Loading
Loading