From 058aa862113ce8f420df0a1f18db41c0a948a5a6 Mon Sep 17 00:00:00 2001 From: Lewis Chambers <lewcha@ceh.ac.uk> Date: Wed, 3 Jul 2024 16:44:17 +0100 Subject: [PATCH] building db no longer needed --- .github/workflows/test.yml | 3 --- .gitignore | 1 + src/iotswarm/utils.py | 1 - tests/data/build_database.py | 22 ---------------------- 4 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 tests/data/build_database.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea5853d..f2d31a0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,9 +24,6 @@ jobs: python -m pip install --upgrade pip pip install flake8 pip install .[test] - - name: Build test DB - run: | - python tests/data/build_database.py - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/.gitignore b/.gitignore index 091353a..9feef4b 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ aws-auth docs/_* *.sh **/*.csv +!ALIC1_4_ROWS.csv **/*.db \ No newline at end of file diff --git a/src/iotswarm/utils.py b/src/iotswarm/utils.py index 3a935eb..e1f8a9e 100644 --- a/src/iotswarm/utils.py +++ b/src/iotswarm/utils.py @@ -4,7 +4,6 @@ from pathlib import Path import pandas import sqlite3 -from glob import glob def json_serial(obj: object): diff --git a/tests/data/build_database.py b/tests/data/build_database.py deleted file mode 100644 index eef80be..0000000 --- a/tests/data/build_database.py +++ /dev/null @@ -1,22 +0,0 @@ -"""This script generates a .db SQLite file from the accompanying .csv data file. -It contains just a few rows of data and is used for testing purposes only.""" - -from iotswarm.utils import build_database_from_csv -from pathlib import Path -from iotswarm.queries import CosmosTable - - -def main(): - data_dir = Path(__file__).parent - data_file = Path(data_dir, "ALIC1_4_ROWS.csv") - database_file = Path(data_dir, "database.db") - - data_table = CosmosTable.LEVEL_1_SOILMET_30MIN - - build_database_from_csv( - data_file, database_file, data_table.value, date_time_format=r"%d-%b-%y" - ) - - -if __name__ == "__main__": - main()