Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
esde
machine-learning
MLAir
Commits
8a9c5ce5
Commit
8a9c5ce5
authored
4 years ago
by
Felix Kleinert
Browse files
Options
Downloads
Patches
Plain Diff
add aggegation_dim to ensure that transformation parameters are calculated on multiple dimensions
parent
45c07a95
No related branches found
No related tags found
1 merge request
!259
Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mlair/data_handler/data_handler_single_station.py
+5
-4
5 additions, 4 deletions
mlair/data_handler/data_handler_single_station.py
with
5 additions
and
4 deletions
mlair/data_handler/data_handler_single_station.py
+
5
−
4
View file @
8a9c5ce5
...
@@ -18,7 +18,7 @@ import xarray as xr
...
@@ -18,7 +18,7 @@ import xarray as xr
from
mlair.configuration
import
check_path_and_create
from
mlair.configuration
import
check_path_and_create
from
mlair
import
helpers
from
mlair
import
helpers
from
mlair.helpers
import
join
,
statistics
,
TimeTrackingWrapper
from
mlair.helpers
import
join
,
statistics
,
TimeTrackingWrapper
,
to_list
from
mlair.data_handler.abstract_data_handler
import
AbstractDataHandler
from
mlair.data_handler.abstract_data_handler
import
AbstractDataHandler
# define a more general date type for type hinting
# define a more general date type for type hinting
...
@@ -61,7 +61,7 @@ class DataHandlerSingleStation(AbstractDataHandler):
...
@@ -61,7 +61,7 @@ class DataHandlerSingleStation(AbstractDataHandler):
interpolation_method
:
Union
[
str
,
Tuple
[
str
]]
=
DEFAULT_INTERPOLATION_METHOD
,
interpolation_method
:
Union
[
str
,
Tuple
[
str
]]
=
DEFAULT_INTERPOLATION_METHOD
,
overwrite_local_data
:
bool
=
False
,
transformation
=
None
,
store_data_locally
:
bool
=
True
,
overwrite_local_data
:
bool
=
False
,
transformation
=
None
,
store_data_locally
:
bool
=
True
,
min_length
:
int
=
0
,
start
=
None
,
end
=
None
,
variables
=
None
,
data_origin
:
Dict
=
None
,
min_length
:
int
=
0
,
start
=
None
,
end
=
None
,
variables
=
None
,
data_origin
:
Dict
=
None
,
lazy_preprocessing
:
bool
=
False
,
**
kwargs
):
lazy_preprocessing
:
bool
=
False
,
aggregation_dim
=
None
,
**
kwargs
):
super
().
__init__
()
super
().
__init__
()
self
.
station
=
helpers
.
to_list
(
station
)
self
.
station
=
helpers
.
to_list
(
station
)
self
.
path
=
self
.
setup_data_path
(
data_path
,
sampling
)
self
.
path
=
self
.
setup_data_path
(
data_path
,
sampling
)
...
@@ -83,6 +83,7 @@ class DataHandlerSingleStation(AbstractDataHandler):
...
@@ -83,6 +83,7 @@ class DataHandlerSingleStation(AbstractDataHandler):
self
.
target_var
=
target_var
self
.
target_var
=
target_var
self
.
time_dim
=
time_dim
self
.
time_dim
=
time_dim
self
.
iter_dim
=
iter_dim
self
.
iter_dim
=
iter_dim
self
.
aggregation_dim
=
time_dim
if
aggregation_dim
is
None
else
set
(
to_list
(
aggregation_dim
)
+
to_list
(
time_dim
))
self
.
window_dim
=
window_dim
self
.
window_dim
=
window_dim
self
.
window_history_size
=
window_history_size
self
.
window_history_size
=
window_history_size
self
.
window_history_offset
=
window_history_offset
self
.
window_history_offset
=
window_history_offset
...
@@ -154,10 +155,10 @@ class DataHandlerSingleStation(AbstractDataHandler):
...
@@ -154,10 +155,10 @@ class DataHandlerSingleStation(AbstractDataHandler):
def
call_transform
(
self
,
inverse
=
False
):
def
call_transform
(
self
,
inverse
=
False
):
opts_input
=
self
.
_transformation
[
0
]
opts_input
=
self
.
_transformation
[
0
]
self
.
input_data
,
opts_input
=
self
.
transform
(
self
.
input_data
,
dim
=
self
.
time
_dim
,
inverse
=
inverse
,
self
.
input_data
,
opts_input
=
self
.
transform
(
self
.
input_data
,
dim
=
self
.
aggregation
_dim
,
inverse
=
inverse
,
opts
=
opts_input
,
transformation_dim
=
self
.
target_dim
)
opts
=
opts_input
,
transformation_dim
=
self
.
target_dim
)
opts_target
=
self
.
_transformation
[
1
]
opts_target
=
self
.
_transformation
[
1
]
self
.
target_data
,
opts_target
=
self
.
transform
(
self
.
target_data
,
dim
=
self
.
time
_dim
,
inverse
=
inverse
,
self
.
target_data
,
opts_target
=
self
.
transform
(
self
.
target_data
,
dim
=
self
.
aggregation
_dim
,
inverse
=
inverse
,
opts
=
opts_target
,
transformation_dim
=
self
.
target_dim
)
opts
=
opts_target
,
transformation_dim
=
self
.
target_dim
)
self
.
_transformation
=
(
opts_input
,
opts_target
)
self
.
_transformation
=
(
opts_input
,
opts_target
)
...
...
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