Skip to content

GEOPY-3110: File collision upon close and repacking of geoh5 workspaces - #1000

Open
sebhmg wants to merge 9 commits into
developfrom
GEOPY-3110
Open

sebhmg wants to merge 9 commits into
developfrom
GEOPY-3110

Conversation

@sebhmg

@sebhmg sebhmg commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

GEOPY-3110 - File collision upon close and repacking of geoh5 workspaces

Copilot AI balanced review requested due to automatic review settings October 19, 2026 19:13
@github-actions github-actions Bot changed the title Geopy 3110 GEOPY-3110: File collision upon close and repacking of geoh5 workspaces Oct 19, 2026
Comment thread geoh5py/workspace/workspace.py Fixed
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.07143% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.03%. Comparing base (3d3e270) to head (4c65a15).

Files with missing lines Patch % Lines
geoh5py/workspace/workspace.py 76.19% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1000   +/-   ##
========================================
  Coverage    91.02%   91.03%           
========================================
  Files          130      130           
  Lines        11326    11347   +21     
  Branches      2091     2092    +1     
========================================
+ Hits         10310    10330   +20     
- Misses         531      532    +1     
  Partials       485      485           
Files with missing lines Coverage Δ
geoh5py/data/data_type.py 93.91% <100.00%> (ø)
geoh5py/data/text_data.py 66.15% <100.00%> (ø)
geoh5py/data/visual_parameters.py 86.84% <100.00%> (ø)
geoh5py/groups/interpretation_section.py 100.00% <100.00%> (ø)
geoh5py/io/h5_writer.py 82.53% <ø> (ø)
geoh5py/objects/geo_image.py 97.34% <ø> (ø)
...jects/surveys/electromagnetics/airborne_app_con.py 90.00% <100.00%> (+0.11%) ⬆️
...y/objects/surveys/electromagnetics/airborne_tem.py 95.12% <100.00%> (+0.12%) ⬆️
...5py/objects/surveys/electromagnetics/ground_fem.py 98.76% <100.00%> (+0.01%) ⬆️
...5py/objects/surveys/electromagnetics/ground_tem.py 100.00% <100.00%> (ø)
... and 6 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Automatic cleanup can delete the only complete workspace copy when cross-filesystem replacement fails.

1 open issue
What changed in this PR

Addresses workspace repacking collisions by isolating temporary output for each close operation.

Changes:

  • Uses a unique temporary directory with automatic cleanup.
  • Adds regression coverage for same-named workspaces and temporary-file cleanup.
  • Updates development dependency locks.
File Description
tests/​workspace_test.py Tests unique repack paths and cleanup.
poetry.lock Refreshes development dependencies.
geoh5py/​workspace/​workspace.py Isolates temporary repack output per operation.

Review effort: Balanced

Comment thread geoh5py/workspace/workspace.py Outdated
while keeping pytlint at 4.0 (pylint 4.1 is raising new findings)
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Force push detected - Previous Copilot review comments may no longer be relevant to the current code. Please resolve any outdated threads and re-request a Copilot review when ready.

@sebhmg
sebhmg requested a review from domfournier October 27, 2026 15:21
@sebhmg

sebhmg commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot, apply fix for
geoh5py/shared/utils.py:929:7: W0177: Comparison 'value is np.nan' should be 'math.isnan(value)' (nan-comparison)

domfournier
domfournier previously approved these changes Oct 29, 2026
Comment thread geoh5py/objects/text.py
Set the attribute value.
"""
if key in TextEntry.model_fields: # pylint: disable=unsupported-membership-test
if key in TextEntry.model_fields.keys():

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that too but writing TextEntry.model_fields.plop(): make pylint happy as well, and not other checks report that plop does no exist :(

so I thought the disable was better than calling a function just for the sake of confusing pylint enough for it not to report

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more about a recent'ish change from pydantic

Comment thread geoh5py/shared/utils.py Outdated

def nan2str(value):
if value is np.nan:
if value is np.nan: # pylint: disable=nan-comparison

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: math.isnan(value) instead of disabling pylint

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Force push detected - Previous Copilot review comments may no longer be relevant to the current code. Please resolve any outdated threads and re-request a Copilot review when ready.

@sebhmg
sebhmg requested a review from domfournier October 29, 2026 22:07
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Force push detected - Previous Copilot review comments may no longer be relevant to the current code. Please resolve any outdated threads and re-request a Copilot review when ready.

Comment thread geoh5py/shared/utils.py
try:
if math.isnan(value):
return ""
except TypeError:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants