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
68a8045e
Commit
68a8045e
authored
5 months ago
by
Nils-Arne Dreier
Committed by
Siddhant Tibrewal
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
feat: add extend_time format for hiopy-configure
parent
f5a13b68
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!12
feat: add extend_time format for hiopy-configure
Pipeline
#90062
failed
5 months ago
Stage: build-image
Stage: build
Stage: test
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/hiopy/configure.py
+12
-2
12 additions, 2 deletions
apps/hiopy/configure.py
with
12 additions
and
2 deletions
apps/hiopy/configure.py
+
12
−
2
View file @
68a8045e
...
...
@@ -79,8 +79,14 @@ def add_variable(dataset, name, yac_source_comp, yac_source_grid,
v
.
attrs
[
"
hiopy::nnn
"
]
=
4
# TODO
# def extent_time()
def
extend_time
(
dataset
,
enddate
):
for
g
in
_collect_groups
(
dataset
):
assert
"
seconds since
"
in
g
.
time
.
attrs
[
"
units
"
],
"
Currently the time must be given in seconds
"
refdate
=
np
.
datetime64
(
g
.
time
.
attrs
[
"
units
"
][
len
(
"
seconds since
"
):])
dt
=
g
.
time
[
1
]
-
g
.
time
[
0
]
enddate_s
=
(
enddate
-
refdate
)
//
np
.
timedelta64
(
1
,
'
s
'
)
g
.
time
.
append
(
np
.
arange
(
g
.
time
[
-
1
]
+
dt
,
enddate_s
+
dt
,
dt
))
print
(
g
)
def
consolidate
(
dataset
):
...
...
@@ -132,6 +138,10 @@ def main():
help
=
"
Name of the frac_mask array in the same group
"
)
add_variable_parser
.
add_argument
(
"
--yac-name
"
,
type
=
str
,
help
=
"
name of the yac field
"
)
extend_time_parser
=
subparsers
.
add_parser
(
"
extend-time
"
)
extend_time_parser
.
set_defaults
(
func
=
extend_time
)
extend_time_parser
.
add_argument
(
"
enddate
"
,
type
=
np
.
datetime64
)
consolidate_parser
=
subparsers
.
add_parser
(
"
consolidate
"
)
consolidate_parser
.
set_defaults
(
func
=
consolidate
)
...
...
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