Commit ddc8e778 authored by Flavio TARSETTI's avatar Flavio TARSETTI

Merge branch '38_improve_offline_plot_support' into 'master'

Improve experiment plot support

Closes #38

See merge request !93
parents 1de0b6e8 562c7727
Pipeline #40136 passed with stages
in 8 minutes and 56 seconds
[flake8]
max-line-length = 80
max-line-length = 88
select = B,C,E,F,W,T4,B9,B950
ignore = E501, W503
ignore = E501, W503, E203
[settings]
line_length=88
order_by_type=true
lines_between_types=1
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/timothycrosley/isort
rev: 4.3.21-2
hooks:
- id: isort
args: [-sl]
- repo: https://github.com/ambv/black
rev: stable
hooks:
......@@ -10,6 +15,8 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.1
hooks:
- id: check-ast
- id: check-case-conflict
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
......@@ -19,7 +26,7 @@ repos:
- id: check-yaml
exclude: conda/meta.yaml
- repo: https://github.com/PyCQA/bandit
rev: master # Update me!
rev: master
hooks:
- id: bandit
args: [-c, .bandit.yml]
......
This diff is collapsed.
......@@ -36,23 +36,25 @@
# Basic tests for the command line beat program: experiments
import os
import logging
import nose.tools
import os
from beat.core.test.utils import slow
from beat.core.test.test_execution import create_conda_environment
from beat.core.test.test_execution import clear_conda_environment
import nose.tools
from beat.core.experiment import Storage, Experiment
from beat.core.toolchain import Storage as TCStorage
from beat.core.algorithm import Storage as AlgStorage
from beat.core.dataformat import Storage as DFStorage
from .utils import index_experiment_dbs, MockLoggingHandler
from beat.core.experiment import Experiment
from beat.core.experiment import Storage
from beat.core.test.test_execution import clear_conda_environment
from beat.core.test.test_execution import create_conda_environment
from beat.core.test.utils import slow
from beat.core.toolchain import Storage as TCStorage
from . import core
from . import prefix, tmp_prefix
from . import prefix
from . import tmp_prefix
from .utils import MockLoggingHandler
from .utils import index_experiment_dbs
def setup_experiments():
......@@ -180,6 +182,43 @@ class TestOnline(core.OnlineAssetTestCase):
exit_code, outputs = self.call("runstatus", obj)
nose.tools.eq_(exit_code, 0, outputs)
@slow
@core.skip_disconnected
def test_plot_local_results(self):
obj = "user/user/single/1/single"
cache_path = os.path.join(tmp_prefix, "cache")
self.test_pull_one(obj)
index_experiment_dbs(obj)
exit_code, outputs = self.call("run", obj, prefix=tmp_prefix, cache=cache_path)
nose.tools.eq_(exit_code, 0, outputs)
plotters = ["plot/scatter/1", "plot/bar/1", "plot/isoroc/1"]
for plotter in plotters:
exit_code, outputs = self.call(
"pull",
plotter,
prefix=tmp_prefix,
asset_type="plotter",
cache=cache_path,
)
nose.tools.eq_(exit_code, 0, outputs)
# now push the new object and then delete it remotely
exit_code, outputs = self.call(
"plot",
"--output-folder=%s" % tmp_prefix,
obj,
prefix=tmp_prefix,
cache=cache_path,
)
nose.tools.eq_(exit_code, 0, outputs)
generated_files = [
file_ for file_ in os.listdir(tmp_prefix) if file_.endswith(".png")
]
nose.tools.assert_true(generated_files)
class TestCache(core.AssetBaseTest):
asset_type = "experiment"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment