INP-PM / FEDM

Finite Element Discharge Modelling code
https://inp-pm.github.io/FEDM/
GNU Lesser General Public License v3.0
10 stars 4 forks source link

Relative_error.log does not exist #7

Closed RaphaelPile closed 1 year ago

RaphaelPile commented 1 year ago

Hello,

Happy to open my first issue on this code.

I was able to install Fenics and FEDM on a container, and run the bash script for tests on my MacOs. Unfortunately not all the tests passed. I have the same error on every failed test so far which is the one below (the .log files do not seem to be created).

tests/integrated_tests/glow_discharge/test_glow_discharge.py::test_glow_discharge_relative_error ERROR                                                                                             [ 20%]
tests/integrated_tests/glow_discharge/test_glow_discharge.py::test_glow_discharge_number_density[electrons] PASSED                                                                                 [ 40%]
tests/integrated_tests/glow_discharge/test_glow_discharge.py::test_glow_discharge_number_density[Ar_1p0] PASSED                                                                                    [ 60%]
tests/integrated_tests/glow_discharge/test_glow_discharge.py::test_glow_discharge_number_density[Ar_plus] PASSED                                                                                   [ 80%]
tests/integrated_tests/glow_discharge/test_glow_discharge.py::test_glow_discharge_number_density[Ar_star] PASSED                                                                                   [100%]

================================================================================================= ERRORS =================================================================================================
__________________________________________________________________________ ERROR at setup of test_glow_discharge_relative_error __________________________________________________________________________

     @pytest.fixture
    def ref_error():
      return get_relative_error(ref_dir / "relative error.log")

tests/integrated_tests/glow_discharge/test_glow_discharge.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/integrated_tests/glow_discharge/test_glow_discharge.py:17: in get_relative_error
    return pd.read_csv(path, sep=r"\s+")
../.local/lib/python3.6/site-packages/pandas/io/parsers.py:688: in read_csv
    return _read(filepath_or_buffer, kwds)
../.local/lib/python3.6/site-packages/pandas/io/parsers.py:454: in _read
    parser = TextFileReader(fp_or_buf, **kwds)
../.local/lib/python3.6/site-packages/pandas/io/parsers.py:948: in __init__
    self._make_engine(self.engine)
../.local/lib/python3.6/site-packages/pandas/io/parsers.py:1180: in _make_engine
    self._engine = CParserWrapper(self.f, **self.options)
../.local/lib/python3.6/site-packages/pandas/io/parsers.py:2010: in __init__
    self._reader = parsers.TextReader(src, **kwds)
pandas/_libs/parsers.pyx:382: in pandas._libs.parsers.TextReader.__cinit__
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

   ???
E   FileNotFoundError: [Errno 2] No such file or directory: '/home/fenics/shared/tests/integrated_tests/glow_discharge/20220707_results/relative error.log'
LiamPattinson commented 1 year ago

Hi, sorry about that! It looks like the .log files were being accidentally excluded by the .gitignore file. I'll open a pull request to get this fixed now.

LiamPattinson commented 1 year ago

Opened a PR for this, hopefully we can get it resolved quickly.

RaphaelPile commented 1 year ago

Your PR works for me. Thanks

RaphaelPile commented 1 year ago

@LiamPattinson I get a similar error with the example: FileNotFoundError: [Errno 2] No such file or directory: '/home/fenics/shared/examples/time_of_flight/output/model.log'

Is it the same type of issue ?

RaphaelPile commented 1 year ago

Ok I found out that it is just missing an "output" folder for results. It can be added manually by user, but it would be better if the code creates automatically the missing folder when running.

LiamPattinson commented 1 year ago

I've just been investigating and came to the same conclusion. It seems truncate_file was failing if a parent directory doesn't exist. I'll push a fix to the same PR.

RaphaelPile commented 1 year ago

Solved with #8