Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enstools-compression
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
w2w
enstools-compression
Commits
767fa339
Commit
767fa339
authored
1 year ago
by
Oriol Tintó
Browse files
Options
Downloads
Patches
Plain Diff
Adjust constrains in test_analyzer.py
parent
9f996ae1
No related branches found
No related tags found
1 merge request
!18
Several changes including chunking and expansion of examples.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_analyzer.py
+15
-2
15 additions, 2 deletions
tests/test_analyzer.py
with
15 additions
and
2 deletions
tests/test_analyzer.py
+
15
−
2
View file @
767fa339
...
...
@@ -85,6 +85,19 @@ class TestAnalyzer(TestClass):
compressor
=
"
zfp
"
,
mode
=
"
rate
"
,
)
def
test_rmse
(
self
):
from
enstools.compression.api
import
analyze_files
input_tempdir
=
self
.
input_directory_path
# Check that the compression without specifying compression parameters works
datasets
=
[
"
dataset_%iD.nc
"
%
dimension
for
dimension
in
range
(
1
,
4
)]
for
ds
in
datasets
:
input_path
=
input_tempdir
/
ds
analyze_files
(
file_paths
=
[
input_path
],
constrains
=
"
normalized_root_mean_square_error:1e-5
"
,
# Keep the analysis to a single compressor and mode to speed up tests
compressor
=
"
zfp
"
,
mode
=
"
rate
"
,
)
def
test_wrong_constrain
(
self
):
from
enstools.compression.api
import
analyze_files
...
...
@@ -115,7 +128,7 @@ class TestAnalyzer(TestClass):
# Check that the analysis using a custom metric defined with a plugin works
datasets
=
[
"
dataset_%iD.nc
"
%
dimension
for
dimension
in
range
(
1
,
4
)]
constrains
=
f
"
{
custom_metric_name
}
:
.
1
"
constrains
=
f
"
{
custom_metric_name
}
:1
e-5
"
for
ds
in
datasets
:
input_path
=
input_tempdir
/
ds
...
...
@@ -154,7 +167,7 @@ class TestAnalyzer(TestClass):
# Check that the analysis using a custom metric defined with a plugin works
datasets
=
[
"
dataset_%iD.nc
"
%
dimension
for
dimension
in
range
(
1
,
4
)]
constrains
=
f
"
{
custom_metric_name
}
:
3
"
constrains
=
f
"
{
custom_metric_name
}
:
1e-5
"
for
ds
in
datasets
:
input_path
=
input_tempdir
/
ds
...
...
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