-
Notifications
You must be signed in to change notification settings - Fork 47
Downhole collection intervals #325
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
sergiopeixoto-seequent
wants to merge
32
commits into
SeequentEvo:main
Choose a base branch
from
sergiopeixoto-seequent:AD2052323-dhc-intervals
base: main
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
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
532621f
feat(objects): add interval and indexed downhole collections
sergiopeixoto-seequent 9808cd9
feat(objects): add typed object prefetch support
sergiopeixoto-seequent aec5e9e
feat(objects): add typed attribute metadata
sergiopeixoto-seequent 1053f66
feat(objects): expose data client context (bump evo-objects to 0.6.2)
sergiopeixoto-seequent 798b0fc
feat(objects): refine typed model and downhole collection; add prefet…
sergiopeixoto-seequent c9c4561
feat(objects): enhance collection handling and add new tests for attr…
sergiopeixoto-seequent 8ecca39
feat(objects-tests): update categorical data generation and improve t…
sergiopeixoto-seequent 2a8a2d2
feat(objects-tests): add unit precedence and attribute type validatio…
sergiopeixoto-seequent 28a2f44
Merge branch 'main' into AD2052323-dhc-intervals
sergiopeixoto-seequent 045ae5b
chore(objects-test): update license information in test_prefetch.py
sergiopeixoto-seequent fba1243
feat(objects): update AttributeDescription to use default empty strings
sergiopeixoto-seequent dc4ee30
refactor(objects): unify table attribute naming in DistanceCollection…
sergiopeixoto-seequent 2dbb04b
feat(objects): Keep dense zero-based categorical codes as the SDK wri…
sergiopeixoto-seequent 73945ff
feat(objects): Require explicit nullable domain choices for units and…
sergiopeixoto-seequent 0efb006
feat(objects): enhance to_dataframe methods to accept attribute selec…
sergiopeixoto-seequent 346325d
feat(objects): require explicit units for downhole distance and inter…
sergiopeixoto-seequent e4b6ae7
feat(objects): moved method to parent class
sergiopeixoto-seequent ffc4d3d
feat(objects): update interval table to use DepthIntervalsTable
sergiopeixoto-seequent 97c220d
feat(objects): enforce unique collection names and handle legacy dupl…
sergiopeixoto-seequent fca9d14
feat(objects): enhance prefetch_collections method with proper names …
sergiopeixoto-seequent c82166d
feat(objects): enhance hole chunk validation with valid indices and r…
sergiopeixoto-seequent d96d54b
feat(objects): refactor DownholeCollection classes to share common be…
sergiopeixoto-seequent 21d2e6b
feat(objects): moves import to module-level
sergiopeixoto-seequent dbbd998
feat(objects): lower the default max concurrency for pre-fetching
sergiopeixoto-seequent 4ce8684
feat(objects): enforces stricted unit type checking
sergiopeixoto-seequent 1a7a2d6
fix(objects): treat downhole hole_index as an opaque lookup key, hole…
sergiopeixoto-seequent a02ac93
feat(objects): enhance DownholeCollectionTable methods with detailed …
sergiopeixoto-seequent 4145125
docs(objects): clarify unit descriptions for collection coordinates a…
sergiopeixoto-seequent 1b48a4e
feat(objects): refine hole index handling and validation in DownholeC…
sergiopeixoto-seequent ea86f6e
docs(objects): update documentation for hole_chunks_from_ids to clari…
sergiopeixoto-seequent c56543e
Merge branch 'SeequentEvo:main' into AD2052323-dhc-intervals
sergiopeixoto-seequent 032b3e1
feat(downhole): enhance hole index handling and validation, update do…
sergiopeixoto-seequent 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
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
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
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
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
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,72 @@ | ||
| # Copyright © 2026 Bentley Systems, Incorporated | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Helpers for warming typed-object data in the local cache.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import asyncio | ||
| from collections.abc import Sequence | ||
| from typing import Any | ||
|
|
||
| from evo.common import IFeedback | ||
| from evo.common.utils import NoFeedback | ||
| from evo.objects import DownloadedObject | ||
| from evo.objects.io import _CACHE_SCOPE | ||
|
|
||
|
|
||
| def collect_data_ids(documents: Any) -> list[str]: | ||
| """Collect de-duplicated ``data`` references from document values.""" | ||
| ids: list[str] = [] | ||
|
|
||
| def visit(value: Any) -> None: | ||
| if isinstance(value, dict): | ||
| for key, nested in value.items(): | ||
| if key == "data" and isinstance(nested, str) and nested not in ids: | ||
| ids.append(nested) | ||
| else: | ||
| visit(nested) | ||
| elif isinstance(value, (list, tuple)): | ||
| for nested in value: | ||
| visit(nested) | ||
|
|
||
| visit(documents) | ||
| return ids | ||
|
|
||
|
|
||
| async def prefetch_object_data( | ||
| obj: DownloadedObject, | ||
| *, | ||
| data_ids: Sequence[str] | None = None, | ||
| max_concurrent: int = 8, | ||
| fb: IFeedback = NoFeedback, | ||
| ) -> None: | ||
| """Warm cache entries referenced by an object, downloading each ID at most once.""" | ||
| if max_concurrent < 1: | ||
| raise ValueError("max_concurrent must be at least 1") | ||
| cache = obj.get_cache() | ||
| if cache is None: | ||
| raise ValueError("prefetch requires an IContext with a cache") | ||
| identifiers = list(dict.fromkeys(data_ids if data_ids is not None else collect_data_ids(obj.as_dict()))) | ||
| if not identifiers: | ||
| return | ||
| cache_location = cache.get_location(environment=obj.get_environment(), scope=_CACHE_SCOPE) | ||
| identifiers = [identifier for identifier in identifiers if not (cache_location / identifier).exists()] | ||
| if not identifiers: | ||
| return | ||
| contexts = list(obj.prepare_data_download(identifiers)) | ||
| semaphore = asyncio.Semaphore(max_concurrent) | ||
|
|
||
| async def download(context: Any) -> None: | ||
| async with semaphore: | ||
| await context.download_to_cache(cache, obj.get_connector().transport, fb=fb) | ||
|
|
||
| await asyncio.gather(*(download(context) for context in contexts)) |
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
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.
Uh oh!
There was an error while loading. Please reload this page.