Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
finam
Manage
Activity
Members
Labels
Plan
Issues
31
Issue boards
Milestones
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FINAM
finam
Commits
20f9a29d
Commit
20f9a29d
authored
2 years ago
by
Martin Lange
Browse files
Options
Downloads
Patches
Plain Diff
put histograms in artifacts
parent
b70e9bd2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!207
Set up benchmarks
Pipeline
#131887
passed with stages
in 4 minutes and 9 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
.gitlab-ci.yml
+4
-1
4 additions, 1 deletion
.gitlab-ci.yml
benchmarks/data/test_tools.py
+14
-0
14 additions, 0 deletions
benchmarks/data/test_tools.py
pyproject.toml
+1
-1
1 addition, 1 deletion
pyproject.toml
with
20 additions
and
2 deletions
.gitignore
+
1
−
0
View file @
20f9a29d
...
...
@@ -49,6 +49,7 @@ nosetests.xml
coverage.xml
*.cover
.hypothesis/
/bench/
# Translations
*.mo
...
...
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
4
−
1
View file @
20f9a29d
...
...
@@ -35,7 +35,10 @@ benchmark:
stage
:
test
script
:
-
pip3 install --editable .[test]
-
python -m pytest -v benchmarks/
-
python -m pytest -v benchmarks/ --benchmark-histogram bench/bench
artifacts
:
paths
:
-
bench
doctest
:
stage
:
test
...
...
This diff is collapsed.
Click to expand it.
benchmarks/data/test_tools.py
+
14
−
0
View file @
20f9a29d
...
...
@@ -23,12 +23,14 @@ class TestCheckXarray(unittest.TestCase):
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_check_xarray_01_2x1
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2
,
1
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
check
,
xdata
=
xdata
,
name
=
"
test
"
,
info
=
info
,
time
=
time
)
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_check_xarray_02_128x64
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
128
,
64
)),
units
=
"
m
"
)
...
...
@@ -41,6 +43,7 @@ class TestToXarray(unittest.TestCase):
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_to_xarray_01_2x1
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2
,
1
)),
units
=
"
m
"
)
...
...
@@ -50,6 +53,7 @@ class TestToXarray(unittest.TestCase):
to_xarray
,
data
=
data
,
name
=
"
test
"
,
info
=
info
,
time
=
time
)
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_to_xarray_02_128x64
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
128
,
64
)),
units
=
"
m
"
)
...
...
@@ -59,6 +63,7 @@ class TestToXarray(unittest.TestCase):
to_xarray
,
data
=
data
,
name
=
"
test
"
,
info
=
info
,
time
=
time
)
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_to_xarray_03_2048x1024
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2048
,
1024
)),
units
=
"
m
"
)
...
...
@@ -74,18 +79,21 @@ class TestTimeTools(unittest.TestCase):
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_strip_time
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2
,
1
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
strip_time
,
xdata
=
xdata
)
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_assign_time_update
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2
,
1
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
assign_time
,
xdata
=
xdata
,
time
=
dt
.
datetime
(
2000
,
1
,
2
))
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_assign_time_add
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2
,
1
)),
units
=
"
m
"
)
...
...
@@ -93,12 +101,14 @@ class TestTimeTools(unittest.TestCase):
xdata
=
strip_time
(
xdata
)
_result
=
self
.
benchmark
(
assign_time
,
xdata
=
xdata
,
time
=
dt
.
datetime
(
2000
,
1
,
2
))
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_get_time
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2
,
1
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
get_time
,
xdata
=
xdata
)
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_has_time
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2
,
1
)),
units
=
"
m
"
)
...
...
@@ -111,24 +121,28 @@ class TestUnitsTools(unittest.TestCase):
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_get_units
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2
,
1
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
get_units
,
xdata
=
xdata
)
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_to_units_2x1
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2
,
1
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
to_units
,
xdata
=
xdata
,
units
=
"
in
"
)
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_to_units_128x64
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
128
,
64
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
to_units
,
xdata
=
xdata
,
units
=
"
in
"
)
@pytest.mark.benchmark
(
group
=
"
tools
"
)
def
test_to_units_2048x1024
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2048
,
1024
)),
units
=
"
m
"
)
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
1
View file @
20f9a29d
...
...
@@ -67,7 +67,7 @@ doc = [
]
test
=
[
"pytest-cov>
=
3
",
"pytest-benchmark>
=
4.0
",
"pytest-benchmark
[histogram]
>
=
4.0
",
]
[tool.setuptools]
...
...
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