Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
adi-notebook
Manage
Activity
Members
Labels
Plan
Issues
8
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Kefei Mo
adi-notebook
Commits
d5a9f803
Commit
d5a9f803
authored
11 months ago
by
Kefei Mo
Browse files
Options
Downloads
Plain Diff
Merge branch 'adi-demo' into 'develop'
Adi demo See merge request
!4
parents
0399ea98
0b5dbf28
No related branches found
Branches containing commit
No related tags found
2 merge requests
!8
updated README pip install pakcage version
,
!4
Adi demo
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/adi_notebook/adi_proc.py
+10
-5
10 additions, 5 deletions
src/adi_notebook/adi_proc.py
with
10 additions
and
5 deletions
src/adi_notebook/adi_proc.py
+
10
−
5
View file @
d5a9f803
...
...
@@ -186,6 +186,8 @@ class AdiRunner: # TODO: better name?
self
.
_end_date
=
end_date
self
.
_pcm_name
=
pcm_name
def
__repr__
(
self
)
->
str
:
return
repr
(
self
.
_adi_process
)
def
process
(
self
,
cached
:
bool
=
False
,
verbose
:
bool
=
True
)
->
ProcessStatus
:
"""
Runs the process and creates retrieved, pre-transformed, post-transformed, and output datasets.
...
...
@@ -231,6 +233,9 @@ class AdiRunner: # TODO: better name?
data
=
self
.
_adi_process
.
_pickle_load_ds
(
filepath
)
return
AdiDatasetList
(
data
)
def
set_transform_pair
(
self
,
input_datastream
:
str
,
coordinate
:
str
):
self
.
_adi_process
.
set_transform_pair
(
input_datastream
,
coordinate
)
class
ADI_Process
(
Process
):
"""
-----------------------------------------------------------------------------------------------------------------
...
...
@@ -365,14 +370,14 @@ class ADI_Process(Process):
EXAMPLE:
get_valid_transform_mappings(display_like=
"
str
"
)
>>
[
'
ceil.b1+=>half_min_grid
'
,
'
ceil.b1+=>mapped
'
,
'
ceil.b1+=>half_min_grid
'
,
'
met.b1+=>half_min_grid
'
,
'
sirs.b1+=>mapped
'
,
'
1twrmr.c1+=>mapped
'
]
[
'
ceil.b1
+=>
half_min_grid
'
,
'
ceil.b1+=>mapped
'
,
'
ceil.b1
+=>
half_min_grid
'
,
'
met.b1+=>half_min_grid
'
,
'
sirs.b1
+=>
mapped
'
,
'
1twrmr.c1+=>mapped
'
]
"""
df
=
self
.
get_pcm_info_as_table
()
df_in_coord_pairs
=
df
[[
"
in_ds
"
,
"
shape
"
]].
explode
(
"
in_ds
"
).
drop_duplicates
().
reset_index
(
drop
=
True
)
if
display_like_str
:
return
(
df_in_coord_pairs
[
"
in_ds
"
]
+
"
+=>
"
+
df_in_coord_pairs
[
"
shape
"
]).
values
.
tolist
()
return
(
df_in_coord_pairs
[
"
in_ds
"
]
+
"
+=>
"
+
df_in_coord_pairs
[
"
shape
"
]).
values
.
tolist
()
else
:
return
df_in_coord_pairs
.
apply
(
lambda
x
:
(
x
[
"
in_ds
"
],
x
[
"
shape
"
]),
axis
=
1
).
values
.
tolist
()
...
...
@@ -753,7 +758,7 @@ class ADI_Process(Process):
ds_copy
=
ds
.
copy
()
# note: it is important to have a deep-copy of it
else
:
ds_copy
=
ds
plan_name
=
pair
[
0
]
+
"
+=>
"
+
pair
[
1
]
plan_name
=
pair
[
0
]
+
"
+=>
"
+
pair
[
1
]
ds_transforms_per_run
[
plan_name
]
=
ds_copy
self
.
_ds_transforms
.
append
(
ds_transforms_per_run
)
...
...
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