UU-ER / AdOpT-NET0

AdOpT-NET0 - Advanced Optimization Tool for Networks and Energy Technologies
https://adopt-net0.readthedocs.io/en/latest/
MIT License
3 stars 3 forks source link

[JOSS]: Failing Test #329

Open trevorb1 opened 9 hours ago

trevorb1 commented 9 hours ago

When I run tests, I receive one failure? Not sure if this is an issue with my environment, or if you are able to replicate as well?

$ coverage run -m pytest
================================================================== test session starts ===================================================================
platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0
rootdir: /home/trevor/repos/AdOpT-NET0
configfile: pyproject.toml
plugins: anyio-4.6.2.post1
collected 32 items                                                                                                                                       

tests/test_balances.py ....                                                                                                                        [ 12%]
tests/test_full_model_flow.py ......                                                                                                               [ 31%]
tests/test_input_data_management.py .                                                                                                              [ 34%]
tests/test_networks.py ...                                                                                                                         [ 43%]
tests/test_preprocessing.py ....                                                                                                                   [ 56%]
tests/test_technologies.py ........F.....                                                                                                          [100%]

======================================================================== FAILURES ========================================================================
________________________________________________________________________ test_dac ________________________________________________________________________

request = <FixtureRequest for <Function test_dac>>

    def test_dac(request):
        """
        tests DAC Adsorption
        """
        time_steps = 1
        technology = "TestTec_DAC_adsorption"
>       tec = define_technology(
            technology, time_steps, request.config.technology_data_folder_path
        )

tests/test_technologies.py:921: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

tec_name = 'TestTec_DAC_adsorption', nr_timesteps = 1, load_path = PosixPath('tests/technology_data'), perf_type = None, CAPEX_model = None

    def define_technology(
        tec_name: str,
        nr_timesteps: int,
        load_path: Path,
        perf_type: int = None,
        CAPEX_model: int = None,
    ):
        """
        Reads technology data and fits it

        :param str tec_name: name of the technology.
        :param int nr_timesteps: Number of timesteps to create climate data for
        :param Path load_path: Path to load from
        :param int perf_type: performance function type (for generic conversion tecs)
        :param int CAPEX_model: capex model (1,2,3,4)
        :return: Technology class
        """
        # Technology Class Creation
>       with open(load_path / (tec_name + ".json")) as json_file:
E       FileNotFoundError: [Errno 2] No such file or directory: 'tests/technology_data/TestTec_DAC_adsorption.json'

tests/test_technologies.py:38: FileNotFoundError
JeanWi commented 4 hours ago

Thanks for reporting! Indeed there was a typo in the technology name. Interestingly it never came to surface for us, as apparently the systems we use are case-insensitive. I assume you use a linux-based system? (just learned about case-sensitive/insensitive systems with this :)).

https://stackoverflow.com/questions/6710511/case-sensitive-path-comparison-in-python