Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MockWeatherDataSource
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
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
MaDiPHS
MockWeatherDataSource
Commits
d7e44f80
Commit
d7e44f80
authored
2 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
fix: Handling missing params
parent
eaae8e8c
No related branches found
No related tags found
No related merge requests found
Pipeline
#485
canceled
2 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/app.py
+2
-1
2 additions, 1 deletion
app/app.py
app/weatherdata_utils.py
+4
-1
4 additions, 1 deletion
app/weatherdata_utils.py
with
6 additions
and
2 deletions
app/app.py
+
2
−
1
View file @
d7e44f80
...
@@ -36,7 +36,8 @@ def get_weather_data():
...
@@ -36,7 +36,8 @@ def get_weather_data():
# Period first
# Period first
weather_data
=
filter_period
(
weather_data
,
time_start
,
time_end
)
weather_data
=
filter_period
(
weather_data
,
time_start
,
time_end
)
# Parameters next
# Parameters next
weather_data
=
filter_params
(
weather_data
,
parameters
)
if
parameters
is
not
None
:
weather_data
=
filter_params
(
weather_data
,
parameters
)
# Aggregation?
# Aggregation?
return
weather_data
.
as_dict
()
return
weather_data
.
as_dict
()
...
...
This diff is collapsed.
Click to expand it.
app/weatherdata_utils.py
+
4
−
1
View file @
d7e44f80
...
@@ -21,7 +21,10 @@ def filter_params(weather_data, params):
...
@@ -21,7 +21,10 @@ def filter_params(weather_data, params):
#print(params)
#print(params)
include_columns_indexes
=
[]
include_columns_indexes
=
[]
for
param
in
params
:
for
param
in
params
:
include_columns_indexes
.
append
(
weather_data
.
weatherParameters
.
index
(
param
))
try
:
include_columns_indexes
.
append
(
weather_data
.
weatherParameters
.
index
(
param
))
except
ValueError
:
pass
for
lwd
in
weather_data
.
locationWeatherData
:
for
lwd
in
weather_data
.
locationWeatherData
:
# Transpose the matrix
# Transpose the matrix
# Referring to this: https://stackoverflow.com/questions/8421337/rotating-a-two-dimensional-array-in-python
# Referring to this: https://stackoverflow.com/questions/8421337/rotating-a-two-dimensional-array-in-python
...
...
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