Skip to content

Commit

Permalink
Mesh loading (#2)
Browse files Browse the repository at this point in the history
* bugfix in mesh loading

* bugfix in epc export

* bugfix for resqml 2.2dev3 reading and mesh loading

* abstraction for external array reading
  • Loading branch information
valentin-gauthier-geosiris authored Apr 23, 2024
1 parent 44b828e commit ad22f33
Show file tree
Hide file tree
Showing 21 changed files with 1,020 additions and 217,064 deletions.
86 changes: 79 additions & 7 deletions energyml-common2-2/src/energyml/eml/v2_2/commonv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -8567,16 +8567,88 @@ class Meta:

@dataclass
class AbstractObject:
"""This element has no type defined, and is therefore implicitly (according to
the rules of W3C XML Schema) an XML Schema anyType.

It is used as the head of an XML Schema substitution group which
unifies complex content and certain simple content elements used for
datatypes in GML, including the gml:AbstractGML substitution group.
"""
The parent class for all top-level elements across the Energistics MLs.

:ivar aliases:
:ivar citation:
:ivar custom_data:
:ivar extension_name_value:
:ivar object_version:
:ivar schema_version:
:ivar uuid:
:ivar existence_kind: A lifecycle state like actual, required,
planned, predicted, etc. This is used to qualify any top-level
element (from Epicentre 2.1).
"""
class Meta:
namespace = "http://www.opengis.net/gml/3.2"
target_namespace = "http://www.energistics.org/energyml/data/commonv2"

aliases: List[ObjectAlias] = field(
default_factory=list,
metadata={
"name": "Aliases",
"type": "Element",
"namespace": "http://www.energistics.org/energyml/data/commonv2",
}
)
citation: Optional[Citation] = field(
default=None,
metadata={
"name": "Citation",
"type": "Element",
"namespace": "http://www.energistics.org/energyml/data/commonv2",
"required": True,
}
)
custom_data: Optional[CustomData] = field(
default=None,
metadata={
"name": "CustomData",
"type": "Element",
"namespace": "http://www.energistics.org/energyml/data/commonv2",
}
)
extension_name_value: List[ExtensionNameValue] = field(
default_factory=list,
metadata={
"name": "ExtensionNameValue",
"type": "Element",
"namespace": "http://www.energistics.org/energyml/data/commonv2",
}
)
object_version: Optional[str] = field(
default=None,
metadata={
"name": "objectVersion",
"type": "Attribute",
"max_length": 64,
}
)
schema_version: Optional[str] = field(
default=None,
metadata={
"name": "schemaVersion",
"type": "Attribute",
"required": True,
"max_length": 64,
}
)
uuid: Optional[str] = field(
default=None,
metadata={
"type": "Attribute",
"required": True,
"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}",
}
)
existence_kind: Optional[ExistenceKind] = field(
default=None,
metadata={
"name": "existenceKind",
"type": "Attribute",
}
)


class AggregationType(Enum):
Expand Down
Empty file.
108,198 changes: 0 additions & 108,198 deletions energyml-utils/example/file.obj

This file was deleted.

108,196 changes: 0 additions & 108,196 deletions energyml-utils/example/file.off

This file was deleted.

35 changes: 19 additions & 16 deletions energyml-utils/example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@
from energyml.resqml.v2_2.resqmlv2 import (
TriangulatedSetRepresentation,
FaultInterpretation,
ContactElement, PointSetRepresentation, AbstractPoint3DArray, AbstractSurfaceFrameworkContact, AbstractColorMap,
ContactElement, AbstractPoint3DArray, AbstractColorMap,
)

from src.energyml.utils.validation import (
patterns_verification,
dor_verification, validate_epc, correct_dor,
)
from src.energyml.utils.data.hdf import *
from src.energyml.utils.epc import *
from src.energyml.utils.introspection import *
from src.energyml.utils.manager import *
from src.energyml.utils.serialization import *
from src.energyml.utils.validation import (
patterns_verification,
dor_verification, validate_epc, correct_dor,
)
from src.energyml.utils.xml import *
from src.energyml.utils.data.hdf import *


fi_cit = Citation(
title="An interpretation",
Expand All @@ -37,7 +36,7 @@
)

tr_cit = Citation(
title="",
title="--",
# title="test title",
originator="Valentin",
creation=epoch_to_date(epoch()),
Expand Down Expand Up @@ -181,6 +180,10 @@ def tests_epc():
epc.export_file(
"D:/Geosiris/Github/energyml/energyml-python/test_EXPANDED.epc"
)
epc.core_props = None
epc.export_file(
"D:/Geosiris/Github/energyml/energyml-python/test_no_core.epc"
)

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


def test_introspection():
Expand Down Expand Up @@ -343,7 +346,7 @@ def test_introspection():

# =====================================================================

poly = read_energyml_xml_file("../../rc/polyline_set_for_array_tests.xml")
poly = read_energyml_xml_file("../rc/polyline_set_for_array_tests.xml")

# print(serialize_xml(poly))

Expand Down Expand Up @@ -376,13 +379,13 @@ def tests_hdf():


if __name__ == "__main__":
# tests_0()
# tests_content_type()
tests_0()
tests_content_type()

# tests_epc()
# tests_dor()
# test_verif()
# test_ast()
tests_epc()
tests_dor()
test_verif()
test_ast()
test_introspection()

tests_hdf()
Expand Down
2 changes: 1 addition & 1 deletion energyml-utils/example/main201.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import importlib

from src.energyml.utils.epc import Epc
from typing import Union, List, Optional


def import_modules():
# import energyml.opc.opc
Expand Down
Loading

0 comments on commit ad22f33

Please sign in to comment.