From fec3a22548ece1605eefb3b29a515b207fdab871 Mon Sep 17 00:00:00 2001 From: Ilka Schulz Date: Thu, 17 Nov 2022 09:09:04 +0100 Subject: [PATCH 1/5] add support for column 27: E_we-E_ce/V (fix #74) --- galvani/BioLogic.py | 1 + 1 file changed, 1 insertion(+) diff --git a/galvani/BioLogic.py b/galvani/BioLogic.py index 8c7c047..535b1fc 100644 --- a/galvani/BioLogic.py +++ b/galvani/BioLogic.py @@ -155,6 +155,7 @@ VMPdata_colID_dtype_map = { 23: ('dQ/mA.h', ' Date: Thu, 17 Nov 2022 09:49:45 +0100 Subject: [PATCH 2/5] add test for column 27 (E_we - E_ce) --- tests/test_BioLogic.py | 1 + tests/testdata/col_27_issue_74.mpr | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 tests/testdata/col_27_issue_74.mpr diff --git a/tests/test_BioLogic.py b/tests/test_BioLogic.py index df90b18..db70c39 100644 --- a/tests/test_BioLogic.py +++ b/tests/test_BioLogic.py @@ -137,6 +137,7 @@ def test_parse_BioLogic_date(data, expected): ("C019P-0ppb-A_C01.mpr", "2019-03-14", "2019-03-14"), ("Rapp_Error.mpr", "2010-12-02", "2010-12-02"), ("Ewe_Error.mpr", "2021-11-18", "2021-11-19"), + ("col_27_issue_74.mpr", "2022-07-28", "2022-07-28"), ], ) def test_MPR_dates(testdata_dir, filename, startdate, enddate): diff --git a/tests/testdata/col_27_issue_74.mpr b/tests/testdata/col_27_issue_74.mpr new file mode 100644 index 0000000..ba6fa3c --- /dev/null +++ b/tests/testdata/col_27_issue_74.mpr @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b473539908334f5bdeece204db6c6ebbd5eba16bc34d75af7afcf9d05ce353bb +size 17046 From 0267b8b59faa31c22521912545a025e2863c6078 Mon Sep 17 00:00:00 2001 From: Chris Kerr Date: Sat, 20 Jan 2024 22:57:45 +0200 Subject: [PATCH 3/5] Bump version to 0.3.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ca4b80b..16f5570 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ with open(os.path.join(os.path.dirname(__file__), "README.md")) as f: setup( name="galvani", - version="0.2.1", + version="0.3.0", description="Open and process battery charger log data files", long_description=readme, long_description_content_type="text/markdown", From 13957160f842a3fedd808b24398e05cc2802efec Mon Sep 17 00:00:00 2001 From: Chris Kerr Date: Sat, 20 Jan 2024 23:36:51 +0200 Subject: [PATCH 4/5] Update regular expression for mdbtools 1.0 output The output formatting has changed - it now puts multiple data rows in a single INSERT statement, and also changes the quoting of text data. --- galvani/res2sqlite.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/galvani/res2sqlite.py b/galvani/res2sqlite.py index 2329473..591b945 100755 --- a/galvani/res2sqlite.py +++ b/galvani/res2sqlite.py @@ -439,7 +439,8 @@ CREATE VIEW IF NOT EXISTS Capacity_View def mdb_get_data_text(s3db, filename, table): print("Reading %s..." % table) insert_pattern = re.compile( - r'INSERT INTO "\w+" \([^)]+?\) VALUES \(("[^"]*"|[^")])+?\);\n', re.IGNORECASE + r"""INSERT INTO "\w+" \([^)]+?\) VALUES (\((('[^']*')|"[^"]*"|[^')])+?\),?\s*)+;\n""", + re.IGNORECASE, ) try: # Initialize values to avoid NameError in except clause From dbd01957db923b4d1824a4bf1b8a4f9f9d277b1c Mon Sep 17 00:00:00 2001 From: Chris Kerr Date: Sat, 20 Jan 2024 23:41:43 +0200 Subject: [PATCH 5/5] Use newer Ubuntu image for CI tests We no longer need to use an old Ubuntu image with old mdbtools version. --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fc4e25..f9e6afe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,8 +17,7 @@ jobs: pytest: name: Run Python unit tests - # Note that 20.04 is currently required until galvani supports mdbtools>=1.0. - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false