Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
toarstats
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
toarstats
Commits
03c6b38a
Commit
03c6b38a
authored
2 years ago
by
Niklas Selke
Browse files
Options
Downloads
Patches
Plain Diff
Adapted the imports and file paths to the new folder structure for the tests.
parent
25987a82
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!5
Modified the test for the 'value_count' statistic. Now all available sampling...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test_metrics/test_stats.py
+1
-1
1 addition, 1 deletion
tests/test_metrics/test_stats.py
tests/test_metrics/test_toarstats.py
+5
-3
5 additions, 3 deletions
tests/test_metrics/test_toarstats.py
with
6 additions
and
4 deletions
tests/test_metrics/test_stats.py
+
1
−
1
View file @
03c6b38a
...
@@ -12,7 +12,7 @@ from toarstats.metrics.interface import calculate_statistics
...
@@ -12,7 +12,7 @@ from toarstats.metrics.interface import calculate_statistics
from
toarstats.metrics.stats_utils
import
create_reference_series
from
toarstats.metrics.stats_utils
import
create_reference_series
data
=
pd
.
read_csv
(
data
=
pd
.
read_csv
(
"
tests/time_series.csv
"
,
header
=
None
,
names
=
[
None
,
"
values
"
],
"
tests/
test_metrics/
time_series.csv
"
,
header
=
None
,
names
=
[
None
,
"
values
"
],
index_col
=
0
,
parse_dates
=
True
,
infer_datetime_format
=
True
index_col
=
0
,
parse_dates
=
True
,
infer_datetime_format
=
True
)
)
ref_data
=
create_reference_series
(
data
.
index
)
ref_data
=
create_reference_series
(
data
.
index
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_metrics/test_toarstats.py
+
5
−
3
View file @
03c6b38a
...
@@ -23,7 +23,9 @@ import numpy as np
...
@@ -23,7 +23,9 @@ import numpy as np
import
pandas
as
pd
import
pandas
as
pd
import
pytest
import
pytest
from
tests.create_sample_data_and_reference_results
import
create_sample_data
from
tests.test_metrics.create_sample_data_and_reference_results
import
(
create_sample_data
)
from
toarstats.metrics.interface
import
calculate_statistics
from
toarstats.metrics.interface
import
calculate_statistics
...
@@ -33,7 +35,7 @@ def get_all_statistics():
...
@@ -33,7 +35,7 @@ def get_all_statistics():
:return: A set of all implemented statistics
:return: A set of all implemented statistics
"""
"""
statistics
=
set
()
statistics
=
set
()
for
file
in
Path
(
Path
(
__file__
).
resolve
().
parents
[
1
],
for
file
in
Path
(
Path
(
__file__
).
resolve
().
parents
[
2
],
"
toarstats/metrics
"
).
glob
(
"
*.py
"
):
"
toarstats/metrics
"
).
glob
(
"
*.py
"
):
for
node
in
ast
.
parse
(
file
.
read_text
(),
file
).
body
:
for
node
in
ast
.
parse
(
file
.
read_text
(),
file
).
body
:
if
(
isinstance
(
node
,
ast
.
FunctionDef
)
if
(
isinstance
(
node
,
ast
.
FunctionDef
)
...
@@ -50,7 +52,7 @@ def get_all_samplings():
...
@@ -50,7 +52,7 @@ def get_all_samplings():
:return: A set of all implemented samplings
:return: A set of all implemented samplings
"""
"""
samplings
=
set
()
samplings
=
set
()
for
file
in
Path
(
Path
(
__file__
).
resolve
().
parents
[
1
],
for
file
in
Path
(
Path
(
__file__
).
resolve
().
parents
[
2
],
"
toarstats/metrics
"
).
glob
(
"
*.py
"
):
"
toarstats/metrics
"
).
glob
(
"
*.py
"
):
for
node
in
ast
.
parse
(
file
.
read_text
(),
file
).
body
:
for
node
in
ast
.
parse
(
file
.
read_text
(),
file
).
body
:
if
(
isinstance
(
node
,
ast
.
Assign
)
if
(
isinstance
(
node
,
ast
.
Assign
)
...
...
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