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
Merge requests
!207
Set up benchmarks
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Set up benchmarks
benchmarks
into
main
Overview
0
Commits
5
Pipelines
9
Changes
5
Merged
Martin Lange
requested to merge
benchmarks
into
main
2 years ago
Overview
0
Commits
5
Pipelines
9
Changes
3
Expand
👍
0
👎
0
Merge request reports
Compare
version 4
version 8
127a1fbf
2 years ago
version 7
515303aa
2 years ago
version 6
94d51d77
2 years ago
version 5
1c4cb6f2
2 years ago
version 4
5c7fd21f
2 years ago
version 3
20f9a29d
2 years ago
version 2
b70e9bd2
2 years ago
version 1
49d06da2
2 years ago
main (base)
and
latest version
latest version
5933c9f1
5 commits,
2 years ago
version 8
127a1fbf
5 commits,
2 years ago
version 7
515303aa
5 commits,
2 years ago
version 6
94d51d77
4 commits,
2 years ago
version 5
1c4cb6f2
3 commits,
2 years ago
version 4
5c7fd21f
3 commits,
2 years ago
version 3
20f9a29d
2 commits,
2 years ago
version 2
b70e9bd2
1 commit,
2 years ago
version 1
49d06da2
1 commit,
2 years ago
Show latest version
3 files
+
101
−
25
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
benchmarks/data/test_tools.py
0 → 100644
+
224
−
0
Options
import
datetime
as
dt
import
unittest
import
pytest
import
finam
as
fm
from
finam.data
import
(
assign_time
,
check
,
full
,
full_like
,
get_magnitude
,
get_time
,
get_units
,
has_time
,
strip_data
,
strip_time
,
to_units
,
to_xarray
,
)
class
TestCheckXarray
(
unittest
.
TestCase
):
@pytest.fixture
(
autouse
=
True
)
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
@pytest.mark.benchmark
(
group
=
"
data-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
=
"
data-tools
"
)
def
test_check_xarray_02_512x256
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
512
,
256
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
check
,
xdata
=
xdata
,
name
=
"
test
"
,
info
=
info
,
time
=
time
)
class
TestToXarray
(
unittest
.
TestCase
):
@pytest.fixture
(
autouse
=
True
)
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
@pytest.mark.benchmark
(
group
=
"
data-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
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
data
=
strip_data
(
xdata
)
_result
=
self
.
benchmark
(
to_xarray
,
data
=
data
,
name
=
"
test
"
,
info
=
info
,
time
=
time
)
@pytest.mark.benchmark
(
group
=
"
data-tools
"
)
def
test_to_xarray_02_512x256
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
512
,
256
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
data
=
strip_data
(
xdata
)
_result
=
self
.
benchmark
(
to_xarray
,
data
=
data
,
name
=
"
test
"
,
info
=
info
,
time
=
time
)
@pytest.mark.benchmark
(
group
=
"
data-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
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
data
=
strip_data
(
xdata
)
_result
=
self
.
benchmark
(
to_xarray
,
data
=
data
,
name
=
"
test
"
,
info
=
info
,
time
=
time
)
class
TestFull
(
unittest
.
TestCase
):
@pytest.fixture
(
autouse
=
True
)
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
@pytest.mark.benchmark
(
group
=
"
data-tools
"
)
def
test_full_01_2x1
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2
,
1
)),
units
=
"
m
"
)
_result
=
self
.
benchmark
(
full
,
value
=
0.0
,
name
=
"
test
"
,
info
=
info
,
time
=
time
)
@pytest.mark.benchmark
(
group
=
"
data-tools
"
)
def
test_full_02_512x256
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
512
,
256
)),
units
=
"
m
"
)
_result
=
self
.
benchmark
(
full
,
value
=
0.0
,
name
=
"
test
"
,
info
=
info
,
time
=
time
)
@pytest.mark.benchmark
(
group
=
"
data-tools
"
)
def
test_full_03_2048x1024
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2048
,
1024
)),
units
=
"
m
"
)
_result
=
self
.
benchmark
(
full
,
value
=
0.0
,
name
=
"
test
"
,
info
=
info
,
time
=
time
)
class
TestFullLike
(
unittest
.
TestCase
):
@pytest.fixture
(
autouse
=
True
)
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
@pytest.mark.benchmark
(
group
=
"
data-tools
"
)
def
test_full_like_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
(
full_like
,
xdata
=
xdata
,
value
=
0.0
)
@pytest.mark.benchmark
(
group
=
"
data-tools
"
)
def
test_full_like_02_512x256
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
512
,
256
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
full_like
,
xdata
=
xdata
,
value
=
0.0
)
@pytest.mark.benchmark
(
group
=
"
data-tools
"
)
def
test_full_like_03_2048x1024
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2048
,
1024
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
full_like
,
xdata
=
xdata
,
value
=
0.0
)
class
TestTimeTools
(
unittest
.
TestCase
):
@pytest.fixture
(
autouse
=
True
)
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
@pytest.mark.benchmark
(
group
=
"
data-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
=
"
data-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
=
"
data-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
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
xdata
=
strip_time
(
xdata
)
_result
=
self
.
benchmark
(
assign_time
,
xdata
=
xdata
,
time
=
dt
.
datetime
(
2000
,
1
,
2
))
@pytest.mark.benchmark
(
group
=
"
data-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
=
"
data-tools
"
)
def
test_has_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
(
has_time
,
xdata
=
xdata
)
class
TestUnitsTools
(
unittest
.
TestCase
):
@pytest.fixture
(
autouse
=
True
)
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
@pytest.mark.benchmark
(
group
=
"
data-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
=
"
data-tools
"
)
def
test_to_units_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
(
to_units
,
xdata
=
xdata
,
units
=
"
in
"
)
@pytest.mark.benchmark
(
group
=
"
data-tools
"
)
def
test_to_units_02_512x256
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
512
,
256
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
to_units
,
xdata
=
xdata
,
units
=
"
in
"
)
@pytest.mark.benchmark
(
group
=
"
data-tools
"
)
def
test_to_units_03_2048x1024
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2048
,
1024
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
to_units
,
xdata
=
xdata
,
units
=
"
in
"
)
@pytest.mark.benchmark
(
group
=
"
data-tools
"
)
def
test_get_magnitude_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
(
get_magnitude
,
xdata
=
xdata
)
@pytest.mark.benchmark
(
group
=
"
data-tools
"
)
def
test_get_magnitude_02_512x256
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
512
,
256
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
get_magnitude
,
xdata
=
xdata
)
@pytest.mark.benchmark
(
group
=
"
data-tools
"
)
def
test_get_magnitude_03_2048x1024
(
self
):
time
=
dt
.
datetime
(
2000
,
1
,
1
)
info
=
fm
.
Info
(
time
=
time
,
grid
=
fm
.
UniformGrid
((
2048
,
1024
)),
units
=
"
m
"
)
xdata
=
full
(
0.0
,
"
test
"
,
info
,
time
)
_result
=
self
.
benchmark
(
get_magnitude
,
xdata
=
xdata
)
Loading