Skip to content

Commit ab6b000

Browse files
bugfix for graphical rendering info
1 parent ca2b1cf commit ab6b000

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

  • energyml-utils/src/energyml/utils/data

energyml-utils/src/energyml/utils/data/helper.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def is_z_reversed(crs: Optional[Any]) -> bool:
9494
:return: By default, ``False`` is returned when *crs* is ``None``.
9595
"""
9696
result = extract_crs_info(crs).z_increasing_downward
97-
logging.debug(f"is_z_reversed: {result}")
97+
# logging.debug(f"is_z_reversed: {result}")
9898
return result
9999

100100

@@ -1796,9 +1796,9 @@ def read_point3d_lattice_array(
17961796
slowest_size = len(slowest_table)
17971797
fastest_size = len(fastest_table)
17981798

1799-
logging.debug(f"slowest vector: {slowest_vec}, spacing: {slowest_spacing}, size: {slowest_size}")
1800-
logging.debug(f"fastest vector: {fastest_vec}, spacing: {fastest_spacing}, size: {fastest_size}")
1801-
logging.debug(f"origin: {origin}")
1799+
# logging.debug(f"slowest vector: {slowest_vec}, spacing: {slowest_spacing}, size: {slowest_size}")
1800+
# logging.debug(f"fastest vector: {fastest_vec}, spacing: {fastest_spacing}, size: {fastest_size}")
1801+
# logging.debug(f"origin: {origin}")
18021802

18031803
if crs_sa_count is not None and len(crs_sa_count) > 0 and crs_fa_count is not None and len(crs_fa_count) > 0:
18041804
if (crs_sa_count[0] == fastest_size and crs_fa_count[0] == slowest_size) or (
@@ -2229,7 +2229,8 @@ def read_graphical_rendering_info(
22292229
**Input**:
22302230
22312231
- *graphical_information_set*: a RESQML/EML ``GraphicalInformationSet``
2232-
object (from ``workspace.get_object(uri)`` or similar).
2232+
object (from ``workspace.get_object(uri)`` or similar), or directly a GraphicalObject (e.g. DefaultGraphicalInformation).
2233+
The function will search for all graphical information entries in the set that target the specified UUID, and accumulate their parameters into a single :class:`ScalarRenderingInfo` output.
22332234
- *target_uuid*: the UUID (string) of the property, representation,
22342235
feature or interpretation you want to render.
22352236
- *workspace*: an :class:`EnergymlStorageInterface` used to resolve the
@@ -2270,7 +2271,7 @@ def read_graphical_rendering_info(
22702271
result = ScalarRenderingInfo(target_obj_uuid=target_uuid)
22712272
found = False
22722273

2273-
gis_infos: List[Any] = getattr(graphical_information_set, "graphical_information", []) or []
2274+
gis_infos: List[Any] = getattr(graphical_information_set, "graphical_information", []) or ([graphical_information_set] if not isinstance(graphical_information_set, list) else graphical_information_set)
22742275

22752276
for info in gis_infos:
22762277
# Each AbstractGraphicalInformation targets ≥1 objects via target_object[].

0 commit comments

Comments
 (0)