Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
coyote
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nils
coyote
Commits
75e06a54
Commit
75e06a54
authored
1 month ago
by
Siddhant Tibrewal
Browse files
Options
Downloads
Patches
Plain Diff
fixed the failing test by reusing the hiopy's assumption of time attribute to exist
parent
d7a3347a
No related branches found
Branches containing commit
No related tags found
1 merge request
!54
Improvements from integration of Hiopy into the Global Hackathon Atmo-only Runs
Pipeline
#102868
waiting for manual action
Stage: lint
Stage: build
Stage: test
Stage: verify
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/hiopy/_distribute_work.py
+2
-6
2 additions, 6 deletions
apps/hiopy/_distribute_work.py
apps/hiopy/tests/test_distribute_work.py
+2
-0
2 additions, 0 deletions
apps/hiopy/tests/test_distribute_work.py
apps/hiopy/worker.py
+4
-4
4 additions, 4 deletions
apps/hiopy/worker.py
with
8 additions
and
10 deletions
apps/hiopy/_distribute_work.py
+
2
−
6
View file @
75e06a54
...
...
@@ -2,11 +2,8 @@
import
logging
from
math
import
ceil
,
prod
import
numpy
as
np
from
._zarr_utils
import
get_time_axis
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -49,9 +46,8 @@ def _estimate_size(*data_vars):
"""
size
=
0.0
for
dv
in
data_vars
:
time_axis
=
get_time_axis
(
dv
)
if
time_axis
is
not
None
:
dt
=
time_axis
[
1
]
-
time_axis
[
0
]
if
dv
.
time
is
not
None
:
dt
=
dv
.
time
[
1
]
-
dv
.
time
[
0
]
size
+=
prod
(
dv
.
shape
[
1
:])
*
dv
.
dtype
.
itemsize
/
dt
return
size
...
...
This diff is collapsed.
Click to expand it.
apps/hiopy/tests/test_distribute_work.py
+
2
−
0
View file @
75e06a54
...
...
@@ -18,7 +18,9 @@ def _create_test_vars():
time
.
attrs
[
"
units
"
]
=
"
seconds since 2000-01-01
"
var1
=
zarr
.
zeros
(
shape
=
[
10
,
10
],
path
=
"
var1
"
,
store
=
store
,
chunks
=
(
2
,
5
))
var1
.
time
=
time
var2
=
zarr
.
zeros
(
shape
=
[
10
,
10
],
path
=
"
var2
"
,
store
=
store
,
chunks
=
(
2
,
5
))
var2
.
time
=
time
for
v
in
(
var1
,
var2
):
v
.
attrs
[
"
_ARRAY_DIMENSIONS
"
]
=
(
"
time
"
,
"
cell
"
)
...
...
This diff is collapsed.
Click to expand it.
apps/hiopy/worker.py
+
4
−
4
View file @
75e06a54
...
...
@@ -146,14 +146,14 @@ def main():
def_grid
(
coyote
,
data_vars
[
0
],
chunk_slice
)
for
v
in
data_vars
:
dt
=
v
[
"
time
"
]
[
1
]
-
v
[
"
time
"
]
[
0
]
dt
=
v
.
time
[
1
]
-
v
.
time
[
0
]
# compute time start index
t0
=
(
np
.
datetime64
(
start_datetime
())
-
np
.
datetime64
(
v
[
"
time
"
]
.
attrs
[
"
units
"
][
len
(
"
seconds since
"
)
:])
-
np
.
datetime64
(
v
.
time
.
attrs
[
"
units
"
][
len
(
"
seconds since
"
)
:])
)
/
np
.
timedelta64
(
1
,
"
s
"
)
+
dt
t0_idx
=
np
.
searchsorted
(
v
[
"
time
"
]
,
t0
)
assert
v
[
"
time
"
]
[
t0_idx
]
==
t0
,
"
start_datetime not found in time axis
"
t0_idx
=
np
.
searchsorted
(
v
.
time
,
t0
)
assert
v
.
time
[
t0_idx
]
==
t0
,
"
start_datetime not found in time axis
"
# see YAC_REDUCTION_TIME_NONE etc. (TODO: pass constants through coyote)
time_methods2yac
=
{
"
point
"
:
0
,
"
sum
"
:
1
,
"
mean
"
:
2
,
"
min
"
:
3
,
"
max
"
:
4
}
...
...
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