Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
toargridding
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
esde
toar-public
toargridding
Commits
0559aabe
Commit
0559aabe
authored
11 months ago
by
Carsten Hinz
Browse files
Options
Downloads
Patches
Plain Diff
started documenting benchmark.py
parent
0e1d9ebb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+2
-1
2 additions, 1 deletion
README.md
tests/benchmark.py
+15
-2
15 additions, 2 deletions
tests/benchmark.py
with
17 additions
and
3 deletions
README.md
+
2
−
1
View file @
0559aabe
...
...
@@ -8,7 +8,7 @@ The request to the database also allows a statistical analysis of the requested
The mean and standard deviation of all stations within a cell are computed.
The tool handles the request to the database over the REST API and the subsequent processing.
The results are provided as xarray objects for subsequent processing by the user.
The results
of the gridding
are provided as xarray objects for subsequent processing by the user.
This project is in beta with the intended basic functionalities.
The documentation is work in progress.
...
...
@@ -70,6 +70,7 @@ quality_controll.ipynb
```
Notebook for downloading and visualization of data.
The data are downloaded and reused for subsequent executions of this notebook.
The gridding is done on the downloaded data. Gridded data are not saved to disc.
# Supported Grids
...
...
This diff is collapsed.
Click to expand it.
tests/benchmark.py
+
15
−
2
View file @
0559aabe
...
...
@@ -16,6 +16,8 @@ TEST_ROOT = Path(__file__).parent
def
get_toar_response
(
start
,
end
):
"""
manual request to the TOAR database
"""
end_with_padding
=
end
+
timedelta
(
1
)
response
=
requests
.
get
(
...
...
@@ -35,6 +37,8 @@ def get_toar_response(start, end):
def
wait_for_data
(
response
):
"""
waiting for data of a manual request
"""
tries
=
0
while
True
:
print
(
f
"
n tries:
{
tries
}
"
)
...
...
@@ -53,6 +57,8 @@ def wait_for_data(response):
def
time_toar_response
(
start
,
end
):
"""
benchmark with manual creation of request to TOAR database
"""
print
(
f
"
starting request for
{
start
}
-
{
end
}
"
)
timer_start
=
datetime
.
now
()
...
...
@@ -64,6 +70,8 @@ def time_toar_response(start, end):
def
wait_for_client_response
(
client
,
sample
):
"""
waiting for response. get_data throws exception after 30min, if results are not available.
"""
for
half_hours
in
range
(
20
):
try
:
client
.
get_data
(
sample
)
...
...
@@ -74,10 +82,15 @@ def wait_for_client_response(client, sample):
def
time_rest_client_response
(
start
,
end
):
print
(
f
"
starting request for
{
start
}
-
{
end
}
"
)
path_cache
=
TEST_ROOT
/
"
temp_data_cache
"
path_data
=
TEST_ROOT
/
"
temp_data
"
path_cache
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
path_data
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
rest_client
=
AnalysisServiceDownload
(
STATISTICS_ENDPOINT
,
TEST_ROOT
/
"
temp_d
at
a
_cache
"
,
TEST_ROOT
/
"
temp
_data
"
,
p
at
h
_cache
,
path
_data
,
use_downloaded
=
False
,
)
time_window
=
TimeSample
(
start
,
end
,
SAMPLING
)
...
...
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