diff --git a/CHANGELOG.md b/CHANGELOG.md index dfba5bc03ecb58fd56711b609536e66481114cec..5fbe3b977dba0814757e20366172e750d52827da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### - An exception in collect_information does no longer lead to a break down. +- Removed dependency on discontiued xlrd version * Fixed an issue where `caosadvancedtools.cache.UpdateCache` would cause an `sqlite3.IntegrityError` if more than one change was cached for the same entity. diff --git a/integrationtests/extroot/DataAnalysis/2010_TestProject/2019-02-03/README.md b/integrationtests/extroot/DataAnalysis/2010_TestProject/2019-02-03/README.md index ce0111b893a41a0e086b2bbf98e30a8ca7af3102..71454e8909393b432ca74fa01e77b33d8b0644d5 100644 --- a/integrationtests/extroot/DataAnalysis/2010_TestProject/2019-02-03/README.md +++ b/integrationtests/extroot/DataAnalysis/2010_TestProject/2019-02-03/README.md @@ -1,7 +1,7 @@ --- responsible: - Only Responsible -description: A description of this example analysis. +description: A description of another example analysis. sources: - file: "/ExperimentalData/2010_TestProject/2019-02-03/*.dat" diff --git a/integrationtests/extroot/ExperimentalData/2010_TestProject/2019-02-03/README.md b/integrationtests/extroot/ExperimentalData/2010_TestProject/2019-02-03/README.md index b9d7ef5e43334fb3191d671921b94200f39a8f7b..b7e5051c7bdbcdafb1bbd3a870b00feecfb109ff 100644 --- a/integrationtests/extroot/ExperimentalData/2010_TestProject/2019-02-03/README.md +++ b/integrationtests/extroot/ExperimentalData/2010_TestProject/2019-02-03/README.md @@ -1,7 +1,7 @@ --- responsible: - Only Responsible -description: A description of this example experiment. +description: A description of another example experiment. results: - file: "/ExperimentalData/2010_TestProject/2019-02-03/*.dat" diff --git a/integrationtests/extroot/Publications/Posters/2019-02-03_really_cool_finding/README.md b/integrationtests/extroot/Publications/Posters/2019-02-03_really_cool_finding/README.md index 6d378818385593b482fa80ef76c77e1c5460a061..c95e37ecc569103d8c3a812e45f1a5110781ea26 100644 --- a/integrationtests/extroot/Publications/Posters/2019-02-03_really_cool_finding/README.md +++ b/integrationtests/extroot/Publications/Posters/2019-02-03_really_cool_finding/README.md @@ -1,7 +1,7 @@ --- responsible: - Only Responsible -description: A description of this example experiment. +description: A description of another example experiment. sources: - /DataAnalysis/2010_TestProject/2019-02-03/results.pdf diff --git a/integrationtests/extroot/SimulationData/2010_TestProject/2019-02-03/README.md b/integrationtests/extroot/SimulationData/2010_TestProject/2019-02-03/README.md index f978bb773f6a8e0ebf0d56f3b302425fe536cb9e..fba1bd48a89514cbff92f9d8bd518484ecaa624b 100644 --- a/integrationtests/extroot/SimulationData/2010_TestProject/2019-02-03/README.md +++ b/integrationtests/extroot/SimulationData/2010_TestProject/2019-02-03/README.md @@ -1,7 +1,7 @@ --- responsible: - Only Responsible -description: A description of this example experiment. +description: A description of another example experiment. results: - file: "*.dat" diff --git a/setup.py b/setup.py index 1d824f51f6c994e070e26f0c0928f36fa5ac7f16..f26b126c2a589554ace736661aa3a685b3f671d3 100755 --- a/setup.py +++ b/setup.py @@ -155,6 +155,7 @@ def setup_package(): author='Henrik tom Wörden', author_email='h.tomwoerden@indiscale.com', install_requires=["caosdb>=0.4.0", + "openpyxl>=3.0.0", "pandas>=1.2.0", "xlrd>=2.0", ], diff --git a/unittests/date.xls b/unittests/date.xls new file mode 100644 index 0000000000000000000000000000000000000000..966ad4dc1d04055d75b455c8d0f9a5ac6f36200d Binary files /dev/null and b/unittests/date.xls differ diff --git a/unittests/test_table_importer.py b/unittests/test_table_importer.py index 6681ed2cd0d79bda9e0e03de7f24c3cb50557395..51b4803d4db00f1b04fdfc4b78792e6a9de61bb8 100644 --- a/unittests/test_table_importer.py +++ b/unittests/test_table_importer.py @@ -77,7 +77,8 @@ class ConverterTest(unittest.TestCase): # TODO datatypes are different; fix it assert df.d.iloc[0] == datetime.datetime(1980, 12, 31, 13, 24, 23) - def test_date(self): + def test_date_xlsx(self): + """Test with .xlsx in order to check openpyxl engine.""" test_file = os.path.join(os.path.dirname(__file__), "date.xlsx") self.importer = XLSImporter(converters={'a': date_converter, 'b': date_converter, @@ -91,6 +92,21 @@ class ConverterTest(unittest.TestCase): assert df.shape[0] == 2 assert df.a.iloc[0] == df.b.iloc[0] == df.c.iloc[0] + def test_date_xls(self): + """Test with .xls in order to check xlrd engine.""" + test_file = os.path.join(os.path.dirname(__file__), "date.xls") + self.importer = XLSImporter(converters={'a': date_converter, + 'b': date_converter, + 'c': partial(date_converter, + fmt="%d.%m.%y") + }, obligatory_columns=['a']) + + xls_file = pd.io.excel.ExcelFile(test_file) + df = xls_file.parse() + df = self.importer.read_xls(test_file) + assert df.shape[0] == 2 + assert df.a.iloc[0] == df.b.iloc[0] == df.c.iloc[0] + def test_inc_date(self): incomplete_date_converter("2020", fmts={"%Y": "%Y"}) == "2020" incomplete_date_converter("02/2020",