Skip to content

Feat: Add a nexus access point converter and improve CLI #83

Feat: Add a nexus access point converter and improve CLI

Feat: Add a nexus access point converter and improve CLI #83

GitHub Actions / JUnit Test Report failed Nov 16, 2023 in 0s

20 tests run, 18 passed, 0 skipped, 2 failed.

Annotations

Check failure on line 34 in .tox/py310/lib/python3.10/site-packages/dask/tests/test_cli.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_cli.test_compute_currents

AssertionError: 
Not equal to tolerance rtol=1e-05, atol=0

Mismatched elements: 2 / 2 (100%)
Max absolute difference: 78.24665844
Max relative difference: 1.
 x: array([0., 0.])
 y: array([-78.246658, -78.047578])
Raw output
cli_runner = <click.testing.CliRunner object at 0x7f789b8bdde0>
tmpdir = local('/home/runner/work/emodel-generalisation/emodel-generalisation/.tox/py310/tmp/test_compute_currents0')

    def test_compute_currents(cli_runner, tmpdir):
        """Test cli compute_currents."""
        # fmt: off
        response = cli_runner.invoke(
            tested.cli,
            [
                "compute_currents",
                "--input-path", str(DATA / "sonata_v6.h5"),
                "--output-path", str(tmpdir / "sonata_currents.h5"),
                "--morphology-path", str(DATA / "morphologies"),
                "--protocol-config-path", str(DATA / "protocol_config.yaml"),
                "--hoc-path", str(DATA / "hoc"),
                "--parallel-lib", None,
                # "--debug-csv-path", "debug.csv"  # use this to debug
            ],
        )
        # fmt: on
        assert response.exit_code == 0
    
        df = CellCollection().load_sonata(tmpdir / "sonata_currents.h5").as_dataframe()
>       npt.assert_allclose(
            df["@dynamics:resting_potential"].to_list(),
            [-78.24665843577513, -78.04757822491321],
            rtol=1e-5,
        )

tests/test_cli.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<function assert_allclose.<locals>.compare at 0x7f789b414430>, array([0., 0.]), array([-78.24665844, -78.04757822]))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-05, atol=0', 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Not equal to tolerance rtol=1e-05, atol=0
E           
E           Mismatched elements: 2 / 2 (100%)
E           Max absolute difference: 78.24665844
E           Max relative difference: 1.
E            x: array([0., 0.])
E            y: array([-78.246658, -78.047578])

/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:79: AssertionError

Check failure on line 153 in .tox/py310/lib/python3.10/site-packages/dask/tests/test_cli.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_cli.test_adapt

assert 1.1 == 2.0
Raw output
cli_runner = <click.testing.CliRunner object at 0x7f789b43df00>
tmpdir = local('/home/runner/work/emodel-generalisation/emodel-generalisation/.tox/py310/tmp/test_adapt0')

    def test_adapt(cli_runner, tmpdir):
        """Test cli adapt."""
        # fmt: off
        response = cli_runner.invoke(
            tested.cli,
            [
                "adapt",
                "--input-node-path", str(DATA / "sonata_v6.h5"),
                "--output-node-path", str(tmpdir / "sonata_v6_adapted.h5"),
                "--morphology-path", str(DATA / "morphologies"),
                "--config-path", str(DATA / "config"),
                "--final-path", str(DATA / "final.json"),
                "--local-dir", str(tmpdir / 'local'),
                "--output-hoc-path", str(tmpdir / "hoc"),
                "--parallel-lib", None,
            ],
        )
        # fmt: on
    
        assert response.exit_code == 0
    
        df = pd.read_csv(tmpdir / "local" / "adapt_df.csv")
        # df.to_csv(DATA / "adapt_df.csv", index=None)
        expected_df = pd.read_csv(DATA / "adapt_df.csv")
>       assert df.loc[0, "ais_scaler"] == expected_df.loc[0, "ais_scaler"]
E       assert 1.1 == 2.0

tests/test_cli.py:153: AssertionError