Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tomoscan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tomotools
tomoscan
Commits
785171d1
Commit
785171d1
authored
3 years ago
by
Pierre Paleo
Browse files
Options
Downloads
Patches
Plain Diff
Rename "old_file_locking" into "existing_file_locking"
parent
2ffe7455
No related branches found
No related tags found
1 merge request
!61
[io][HDF5File] benefit when possible of the "locking" parameter from h5py
Pipeline
#59174
failed
3 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tomoscan/io.py
+3
-3
3 additions, 3 deletions
tomoscan/io.py
with
3 additions
and
3 deletions
tomoscan/io.py
+
3
−
3
View file @
785171d1
...
...
@@ -72,7 +72,7 @@ class HDF5File(h5py.File):
kwargs
[
"
libver
"
]
=
"
latest
"
if
enable_file_locking
is
None
:
enable_file_locking
=
mode
!=
"
r
"
old
_file_locking
=
os
.
environ
.
get
(
"
HDF5_USE_FILE_LOCKING
"
,
None
)
existing
_file_locking
=
os
.
environ
.
get
(
"
HDF5_USE_FILE_LOCKING
"
,
None
)
def
use_h5py_API_for_file_locking
():
"""
use h5py API if (for HDF5 >= 1.12.1 or 1.10.x >= 1.10.7)
"""
...
...
@@ -134,10 +134,10 @@ class HDF5File(h5py.File):
kwargs
[
"
libver
"
]
=
libver
super
().
__init__
(
filename
,
mode
=
mode
,
swmr
=
swmr
,
**
kwargs
)
if
not
use_h5py_API_for_file_locking
():
if
old
_file_locking
is
None
:
if
existing
_file_locking
is
None
:
del
os
.
environ
[
"
HDF5_USE_FILE_LOCKING
"
]
else
:
os
.
environ
[
"
HDF5_USE_FILE_LOCKING
"
]
=
old
_file_locking
os
.
environ
[
"
HDF5_USE_FILE_LOCKING
"
]
=
existing
_file_locking
@contextmanager
def
_protect_init
(
self
,
filename
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment