OSeMOSYS / otoole

OSeMOSYS Tools for Energy
https://otoole.readthedocs.io
MIT License
23 stars 17 forks source link

[Bug]: `pandas v2.1` breaks tests #194

Closed trevorb1 closed 8 months ago

trevorb1 commented 1 year ago

The Issue

pandas recently released v2.1.0 which now breaks 12 tests. The pandas version has been locked to be <2.1 in Pr #193.

Expected Behavior

All tests should pass

Steps To Reproduce

  1. Remove the pandas<2.1 restriction in the docs/requirements.txt and setup.cfg file
  2. Run tox -r

Log output

============================================================ short test summary info ============================================================
FAILED tests/test_input.py::TestExpandDefaults::test_expand_parameters_defaults[multi_index_empty] - AssertionError: MultiIndex level [2] are different
FAILED tests/test_read_strategies.py::TestReadGlpk::test_read_model - pandas.errors.ParserError: Error tokenizing data. C error: Expected 6 fields in line 7, saw 7
FAILED tests/test_read_strategies.py::TestReadGlpk::test_read_solution - pandas.errors.ParserError: Error tokenizing data. C error: Expected 6 fields in line 7, saw 7
FAILED tests/test_read_strategies.py::TestReadGlpk::test_merge_model_sol - pandas.errors.ParserError: Error tokenizing data. C error: Expected 6 fields in line 7, saw 7
FAILED tests/test_read_strategies.py::TestReadGlpk::test_convert_to_dataframe - pandas.errors.ParserError: Error tokenizing data. C error: Expected 6 fields in line 7, saw 7
FAILED tests/test_read_strategies.py::TestReadGlpk::test_convert_to_dataframe_error - pandas.errors.ParserError: Error tokenizing data. C error: Expected 6 fields in line 7, saw 7
FAILED tests/results/test_results_package.py::TestAccumulatedNewCapacity::test_individual - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
FAILED tests/results/test_results_package.py::TestAccumulatedNewCapacity::test_overlapping - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
FAILED tests/results/test_results_package.py::TestAccumulatedNewCapacity::test_overlapping_bitty - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
FAILED tests/results/test_results_package.py::TestDiscountFactorStorage::test_dfs_start - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
FAILED tests/results/test_results_package.py::TestDiscountFactorStorage::test_dfs_mid - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
FAILED tests/results/test_results_package.py::TestDiscountFactorStorage::test_dfs_end - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)

Operating System

Linux

What version of otoole are you running?

1.1.0

Possible Solution

No response

Anything else?

No response