-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/horizon stack #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SpliiT
wants to merge
16
commits into
next
Choose a base branch
from
feat/HorizonStack
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat/horizon stack #259
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c6f3a4f
feat(HorizonStack): Add Horizon Stack to the horizon step
SpliiT 8b9dd98
fix utils functions
SpliiT 7a98960
Apply prepare changes
SpliiT 8b7ade0
add missing test.og_hst3d
SpliiT 72b1089
Merge branch 'feat/HorizonStack' of https://github.com/Geode-solution…
SpliiT 49fa924
Merge branch 'next' into feat/HorizonStack
SpliiT 28cd18e
Apply prepare changes
SpliiT 21df80a
resolve mypy errors on GeodeHorizonStack3D and utils
SpliiT f656590
Merge branch 'feat/HorizonStack' of https://github.com/Geode-solution…
SpliiT c75f16c
Apply prepare changes
SpliiT c9f3d0b
rm comments
SpliiT 9583a1e
Merge branch 'feat/HorizonStack' of https://github.com/Geode-solution…
SpliiT 7f9b1d2
Apply prepare changes
SpliiT 2a0ecbd
fix comments
SpliiT 05eec1a
Merge branch 'feat/HorizonStack' of https://github.com/Geode-solution…
SpliiT 6785a86
reput asserts data
SpliiT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,4 +66,3 @@ werkzeug==3.1.8 | |
| # flask | ||
| # flask-cors | ||
|
|
||
| opengeodeweb-microservice==1.*,>=1.1.4 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
src/opengeodeweb_back/geode_objects/geode_horizon_stack3d.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| # Standard library imports | ||
| from __future__ import annotations | ||
| from typing import Any | ||
|
|
||
| # Third party imports | ||
| import opengeode as og | ||
| import opengeode_geosciences as og_geosciences | ||
| from opengeodeweb_microservice.database.data_types import GeodeModelType | ||
|
|
||
| # Local application imports | ||
| from .geode_model import GeodeModel, ComponentRegistry | ||
|
|
||
|
|
||
| class GeodeHorizonStack3D(GeodeModel): | ||
| horizon_stack: og_geosciences.HorizonsStack3D | ||
|
|
||
| def __init__( | ||
| self, horizon_stack: og_geosciences.HorizonsStack3D | None = None | ||
| ) -> None: | ||
| self.horizon_stack = ( | ||
| horizon_stack | ||
| if horizon_stack is not None | ||
| else og_geosciences.HorizonsStack3D() | ||
| ) | ||
| super().__init__(self.horizon_stack) | ||
|
|
||
| @classmethod | ||
| def geode_object_type(cls) -> GeodeModelType: | ||
| return "HorizonStack3D" | ||
|
|
||
| def native_extension(self) -> str: | ||
| return self.horizon_stack.native_extension() | ||
|
|
||
| @classmethod | ||
| def is_3D(cls) -> bool: | ||
| return True | ||
|
|
||
| @classmethod | ||
| def is_viewable(cls) -> bool: | ||
| return False | ||
|
|
||
| def builder(self) -> og_geosciences.HorizonsStackBuilder3D: | ||
| return og_geosciences.HorizonsStackBuilder3D(self.horizon_stack) | ||
|
|
||
| @classmethod | ||
| def load(cls, filename: str) -> GeodeHorizonStack3D: | ||
| return GeodeHorizonStack3D(og_geosciences.load_horizons_stack3D(filename)) | ||
|
|
||
| @classmethod | ||
| def additional_files(cls, filename: str) -> og.AdditionalFiles: | ||
| return og_geosciences.horizons_stack_additional_files3D(filename) | ||
|
|
||
| @classmethod | ||
| def is_loadable(cls, filename: str) -> og.Percentage: | ||
| return og_geosciences.is_horizons_stack_loadable3D(filename) | ||
|
|
||
| @classmethod | ||
| def input_extensions(cls) -> list[str]: | ||
| if hasattr(og_geosciences, "HorizonsStackInputFactory3D"): | ||
| return og_geosciences.HorizonsStackInputFactory3D.list_creators() | ||
| return [] | ||
|
|
||
| @classmethod | ||
| def output_extensions(cls) -> list[str]: | ||
| if hasattr(og_geosciences, "HorizonsStackOutputFactory3D"): | ||
| return og_geosciences.HorizonsStackOutputFactory3D.list_creators() | ||
| return [] | ||
|
|
||
| @classmethod | ||
| def object_priority(cls, filename: str) -> int: | ||
| if hasattr(og_geosciences, "horizons_stack_object_priority3D"): | ||
| return og_geosciences.horizons_stack_object_priority3D(filename) | ||
| return 0 | ||
|
|
||
| def is_saveable(self, filename: str) -> bool: | ||
| if hasattr(og_geosciences, "is_horizons_stack_saveable3D"): | ||
| return bool( | ||
| og_geosciences.is_horizons_stack_saveable3D( | ||
| self.horizon_stack, filename | ||
| ) | ||
| ) | ||
| return True | ||
|
|
||
| def save(self, filename: str) -> list[str]: | ||
| if hasattr(og_geosciences, "save_horizons_stack3D"): | ||
| return og_geosciences.save_horizons_stack3D(self.horizon_stack, filename) | ||
| return [] | ||
|
|
||
| def save_viewable(self, filename_without_extension: str) -> str: | ||
| return "" | ||
|
|
||
| def save_light_viewable(self, filename_without_extension: str) -> str: | ||
| return "" | ||
|
|
||
| def mesh_components(self) -> ComponentRegistry: | ||
| return {} | ||
|
|
||
| def collection_components(self) -> ComponentRegistry: | ||
| return {} | ||
|
|
||
| def boundaries(self, id: og.uuid) -> list[og.ComponentID]: | ||
|
SpliiT marked this conversation as resolved.
|
||
| return [] | ||
|
|
||
| def internals(self, id: og.uuid) -> list[og.ComponentID]: | ||
| return [] | ||
|
|
||
| def items(self, id: og.uuid) -> list[og.ComponentID]: | ||
| return [] | ||
|
|
||
| def component(self, id: og.uuid) -> og.Component3D: | ||
| raise NotImplementedError("HorizonStack3D has no mesh components") | ||
|
|
||
| def inspect(self) -> Any: | ||
| return None | ||
|
|
||
| def validate(self) -> Any: | ||
| return None | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il faut supprimer ces hasattr. On peut en discuter si tu veux mais ça ne fait pas sens