Skip to content

Commit ad22f33

Browse files
Mesh loading (#2)
* bugfix in mesh loading * bugfix in epc export * bugfix for resqml 2.2dev3 reading and mesh loading * abstraction for external array reading
1 parent 44b828e commit ad22f33

21 files changed

Lines changed: 1020 additions & 217064 deletions

energyml-common2-2/src/energyml/eml/v2_2/commonv2.py

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8567,16 +8567,88 @@ class Meta:
85678567

85688568
@dataclass
85698569
class AbstractObject:
8570-
"""This element has no type defined, and is therefore implicitly (according to
8571-
the rules of W3C XML Schema) an XML Schema anyType.
8572-
8573-
It is used as the head of an XML Schema substitution group which
8574-
unifies complex content and certain simple content elements used for
8575-
datatypes in GML, including the gml:AbstractGML substitution group.
85768570
"""
8571+
The parent class for all top-level elements across the Energistics MLs.
85778572

8573+
:ivar aliases:
8574+
:ivar citation:
8575+
:ivar custom_data:
8576+
:ivar extension_name_value:
8577+
:ivar object_version:
8578+
:ivar schema_version:
8579+
:ivar uuid:
8580+
:ivar existence_kind: A lifecycle state like actual, required,
8581+
planned, predicted, etc. This is used to qualify any top-level
8582+
element (from Epicentre 2.1).
8583+
"""
85788584
class Meta:
8579-
namespace = "http://www.opengis.net/gml/3.2"
8585+
target_namespace = "http://www.energistics.org/energyml/data/commonv2"
8586+
8587+
aliases: List[ObjectAlias] = field(
8588+
default_factory=list,
8589+
metadata={
8590+
"name": "Aliases",
8591+
"type": "Element",
8592+
"namespace": "http://www.energistics.org/energyml/data/commonv2",
8593+
}
8594+
)
8595+
citation: Optional[Citation] = field(
8596+
default=None,
8597+
metadata={
8598+
"name": "Citation",
8599+
"type": "Element",
8600+
"namespace": "http://www.energistics.org/energyml/data/commonv2",
8601+
"required": True,
8602+
}
8603+
)
8604+
custom_data: Optional[CustomData] = field(
8605+
default=None,
8606+
metadata={
8607+
"name": "CustomData",
8608+
"type": "Element",
8609+
"namespace": "http://www.energistics.org/energyml/data/commonv2",
8610+
}
8611+
)
8612+
extension_name_value: List[ExtensionNameValue] = field(
8613+
default_factory=list,
8614+
metadata={
8615+
"name": "ExtensionNameValue",
8616+
"type": "Element",
8617+
"namespace": "http://www.energistics.org/energyml/data/commonv2",
8618+
}
8619+
)
8620+
object_version: Optional[str] = field(
8621+
default=None,
8622+
metadata={
8623+
"name": "objectVersion",
8624+
"type": "Attribute",
8625+
"max_length": 64,
8626+
}
8627+
)
8628+
schema_version: Optional[str] = field(
8629+
default=None,
8630+
metadata={
8631+
"name": "schemaVersion",
8632+
"type": "Attribute",
8633+
"required": True,
8634+
"max_length": 64,
8635+
}
8636+
)
8637+
uuid: Optional[str] = field(
8638+
default=None,
8639+
metadata={
8640+
"type": "Attribute",
8641+
"required": True,
8642+
"pattern": r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
8643+
}
8644+
)
8645+
existence_kind: Optional[ExistenceKind] = field(
8646+
default=None,
8647+
metadata={
8648+
"name": "existenceKind",
8649+
"type": "Attribute",
8650+
}
8651+
)
85808652

85818653

85828654
class AggregationType(Enum):

energyml-utils/example/__init__.py

Whitespace-only changes.

energyml-utils/example/file.obj

Lines changed: 0 additions & 108198 deletions
This file was deleted.

energyml-utils/example/file.off

Lines changed: 0 additions & 108196 deletions
This file was deleted.

energyml-utils/example/main.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@
66
from energyml.resqml.v2_2.resqmlv2 import (
77
TriangulatedSetRepresentation,
88
FaultInterpretation,
9-
ContactElement, PointSetRepresentation, AbstractPoint3DArray, AbstractSurfaceFrameworkContact, AbstractColorMap,
9+
ContactElement, AbstractPoint3DArray, AbstractColorMap,
1010
)
1111

12-
from src.energyml.utils.validation import (
13-
patterns_verification,
14-
dor_verification, validate_epc, correct_dor,
15-
)
12+
from src.energyml.utils.data.hdf import *
1613
from src.energyml.utils.epc import *
1714
from src.energyml.utils.introspection import *
1815
from src.energyml.utils.manager import *
1916
from src.energyml.utils.serialization import *
17+
from src.energyml.utils.validation import (
18+
patterns_verification,
19+
dor_verification, validate_epc, correct_dor,
20+
)
2021
from src.energyml.utils.xml import *
21-
from src.energyml.utils.data.hdf import *
22-
2322

2423
fi_cit = Citation(
2524
title="An interpretation",
@@ -37,7 +36,7 @@
3736
)
3837

3938
tr_cit = Citation(
40-
title="",
39+
title="--",
4140
# title="test title",
4241
originator="Valentin",
4342
creation=epoch_to_date(epoch()),
@@ -181,6 +180,10 @@ def tests_epc():
181180
epc.export_file(
182181
"D:/Geosiris/Github/energyml/energyml-python/test_EXPANDED.epc"
183182
)
183+
epc.core_props = None
184+
epc.export_file(
185+
"D:/Geosiris/Github/energyml/energyml-python/test_no_core.epc"
186+
)
184187

185188
epc201 = Epc.read_file(
186189
"D:/Geosiris/OSDU/manifestTranslation/#Data/VOLVE_STRUCT.epc"
@@ -259,7 +262,7 @@ def test_ast():
259262
ll.remove(type(None))
260263
print(ll)
261264
print(list(eval("List[ObjectAlias]").__args__))
262-
print(random_value_from_class(tr))
265+
print(random_value_from_class(tr.__class__))
263266

264267

265268
def test_introspection():
@@ -343,7 +346,7 @@ def test_introspection():
343346

344347
# =====================================================================
345348

346-
poly = read_energyml_xml_file("../../rc/polyline_set_for_array_tests.xml")
349+
poly = read_energyml_xml_file("../rc/polyline_set_for_array_tests.xml")
347350

348351
# print(serialize_xml(poly))
349352

@@ -376,13 +379,13 @@ def tests_hdf():
376379

377380

378381
if __name__ == "__main__":
379-
# tests_0()
380-
# tests_content_type()
382+
tests_0()
383+
tests_content_type()
381384

382-
# tests_epc()
383-
# tests_dor()
384-
# test_verif()
385-
# test_ast()
385+
tests_epc()
386+
tests_dor()
387+
test_verif()
388+
test_ast()
386389
test_introspection()
387390

388391
tests_hdf()

energyml-utils/example/main201.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import importlib
44

55
from src.energyml.utils.epc import Epc
6-
from typing import Union, List, Optional
6+
77

88
def import_modules():
99
# import energyml.opc.opc

0 commit comments

Comments
 (0)