Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tzis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
data-infrastructure-services
tzis
Commits
20b5a798
Commit
20b5a798
authored
3 years ago
by
Fabian Wachsmann
Browse files
Options
Downloads
Patches
Plain Diff
Debugged open store
parent
e3eb6d43
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
To class
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tzis/tzis.py
+8
-8
8 additions, 8 deletions
tzis/tzis.py
with
8 additions
and
8 deletions
tzis/tzis.py
+
8
−
8
View file @
20b5a798
...
@@ -9,11 +9,12 @@ import shutil
...
@@ -9,11 +9,12 @@ import shutil
import
math
import
math
from
tqdm
import
tqdm
from
tqdm
import
tqdm
class
Tzis
(
SwiftStore
):
class
Tzis
():
def
__init__
(
self
,
def
__init__
(
self
,
os_url
,
os_url
,
os_token
,
os_token
,
os_container
,
os_container
,
os_name
=
None
,
mf_dset
=
None
,
mf_dset
=
None
,
varname
=
None
,
varname
=
None
,
verbose
=
False
verbose
=
False
...
@@ -21,8 +22,8 @@ class Tzis(SwiftStore):
...
@@ -21,8 +22,8 @@ class Tzis(SwiftStore):
self
.
auth
=
{
self
.
auth
=
{
"
preauthurl
"
:
os_url
,
"
preauthurl
"
:
os_url
,
"
preauthtoken
"
:
os_token
,
"
preauthtoken
"
:
os_token
,
}
}
SwiftStore
.
__init__
(
self
,
os_container
,
""
,
self
.
auth
)
self
.
store
=
SwiftStore
(
os_container
,
prefix
=
os_name
,
storage_options
=
self
.
auth
)
self
.
verbose
=
verbose
self
.
verbose
=
verbose
#
#
self
.
mf_dset
=
self
.
open_mf_dataset
(
mf_dset
)
self
.
mf_dset
=
self
.
open_mf_dataset
(
mf_dset
)
...
@@ -50,9 +51,8 @@ class Tzis(SwiftStore):
...
@@ -50,9 +51,8 @@ class Tzis(SwiftStore):
return
varname
return
varname
def
open_store
(
self
,
os_name
):
def
open_store
(
self
,
os_name
):
self
.
_SwiftStore
=
SwiftStore
(
container
=
self
.
_SwiftStore
.
container
,
self
.
store
.
prefix
=
os_name
prefix
=
os_name
,
return
self
.
store
storage_options
=
self
.
auth
)
# `getSizeOfVarTimeseries`
# `getSizeOfVarTimeseries`
# returns the size of the variable `varname`of the entire dataset `ds` used for chunking. Dataset can be multiple files.
# returns the size of the variable `varname`of the entire dataset `ds` used for chunking. Dataset can be multiple files.
#
#
...
@@ -284,14 +284,14 @@ class Tzis(SwiftStore):
...
@@ -284,14 +284,14 @@ class Tzis(SwiftStore):
if
len
(
timevars
)
>
0
:
if
len
(
timevars
)
>
0
:
self
.
write_with_validation_and_retries
(
self
.
mf_dset
,
self
.
write_with_validation_and_retries
(
self
.
mf_dset
,
self
.
varname
,
self
.
varname
,
self
.
_SwiftS
tore
,
self
.
s
tore
,
chunkdim
,
chunkdim
,
target_mb
,
target_mb
,
startchunk
,
startchunk
,
validity_check
,
validity_check
,
maxretries
)
maxretries
)
else
:
else
:
self
.
write_directly
(
self
.
mf_dset
,
self
.
_SwiftS
tore
)
self
.
write_directly
(
self
.
mf_dset
,
self
.
s
tore
)
self
.
mf_dset
.
close
()
self
.
mf_dset
.
close
()
# In[17]:
# In[17]:
...
...
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