diff --git a/.env b/.env index 2c1882ab..a09bd817 100644 --- a/.env +++ b/.env @@ -1,9 +1,9 @@ -# this is the directory that the galvanalyser postgres database will be located -GALVANALYSER_DATA_PATH=./.run/data/galvanalyser +# this is the directory that the galv postgres database will be located +GALV_DATA_PATH=./.run/data/galv # this is the directory that will be scanned for battery tester output files when # running the harvester test suite -GALVANALYSER_HARVESTER_TEST_PATH=./.run/test_datafiles +GALV_HARVESTER_TEST_PATH=./.run/test_datafiles # Required to get react running: NODE_OPTIONS=--openssl-legacy-provider diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 7622a878..cfe9f705 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: Create a report to help us improve Galvanalyser +about: Create a report to help us improve Galv title: '' labels: bug assignees: '' diff --git a/.github/workflows/side-effects.yml b/.github/workflows/side-effects.yml index 2de90746..7834a604 100644 --- a/.github/workflows/side-effects.yml +++ b/.github/workflows/side-effects.yml @@ -28,7 +28,7 @@ jobs: build-erd: runs-on: ubuntu-latest env: - POSTGRES_PASSWORD: "galvanalyser" + POSTGRES_PASSWORD: "galv" DJANGO_SECRET_KEY: "long-and-insecure-key-12345" steps: - uses: actions/checkout@v3 @@ -44,7 +44,7 @@ jobs: - name: Create Entity Relationship Diagram run: | - docker-compose -f docker-compose.docs.yml run app python manage.py graph_models --dot --output output.dot galvanalyser + docker-compose -f docker-compose.docs.yml run app python manage.py graph_models --dot --output output.dot galv dot -Tpng backend/backend_django/output.dot -o docs/source/resources/ERD.png - name: Create API spec @@ -56,9 +56,9 @@ jobs: - name: Create API client run: | echo "{\"lang\": \"python\", \"type\": \"CLIENT\", \"codegenVersion\": \"V3\", \"spec\": $(cat docs/schema.json)}" > payload.json - curl -d @payload.json --output docs/source/resources/galvanalyser-client-python.zip -H "Content-Type: application/json" https://generator3.swagger.io/api/generate + curl -d @payload.json --output docs/source/resources/galv-client-python.zip -H "Content-Type: application/json" https://generator3.swagger.io/api/generate # Check size - if [ ! -s docs/source/resources/galvanalyser-client-python.zip ]; then + if [ ! -s docs/source/resources/galv-client-python.zip ]; then echo "Downloaded python client zip file is zero bytes" exit 1 fi diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 1f2fd821..3ddb108f 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -18,7 +18,7 @@ jobs: test-harvester: runs-on: ubuntu-latest env: - GALVANALYSER_HARVESTER_TEST_PATH: .test_datafiles + GALV_HARVESTER_TEST_PATH: .test_datafiles steps: - uses: actions/checkout@v3 @@ -31,7 +31,7 @@ jobs: id: cache-restore uses: actions/cache/restore@v3 with: - path: ${{ env.GALVANALYSER_HARVESTER_TEST_PATH }} + path: ${{ env.GALV_HARVESTER_TEST_PATH }} key: liionsden-test-suite - name: Download test suite @@ -41,8 +41,8 @@ jobs: LIIONSDEN_SMB_USERNAME: ${{ secrets.LIIONSDEN_SMB_USERNAME}} LIIONSDEN_SMB_PASSWORD: ${{ secrets.LIIONSDEN_SMB_PASSWORD}} run: | - sudo mkdir -p $GALVANALYSER_HARVESTER_TEST_PATH - cd $GALVANALYSER_HARVESTER_TEST_PATH + sudo mkdir -p $GALV_HARVESTER_TEST_PATH + cd $GALV_HARVESTER_TEST_PATH sudo smbget -R $LIIONSDEN_SMB_PATH/test-suite-small -U "$LIIONSDEN_SMB_USERNAME%$LIIONSDEN_SMB_PASSWORD" - name: Cache test suite @@ -50,7 +50,7 @@ jobs: if: steps.cache-restore.outputs.cache-hit != 'true' uses: actions/cache/save@v3 with: - path: ${{ env.GALVANALYSER_HARVESTER_TEST_PATH }} + path: ${{ env.GALV_HARVESTER_TEST_PATH }} key: ${{ steps.cache-restore.outputs.cache-primary-key }} - name: Build the stack @@ -67,7 +67,7 @@ jobs: test-backend: runs-on: ubuntu-latest env: - POSTGRES_PASSWORD: "galvanalyser" + POSTGRES_PASSWORD: "galv" DJANGO_SECRET_KEY: "long-and-insecure-key-12345" FRONTEND_VIRTUAL_HOST: "http://localhost" VIRTUAL_HOST: "localhost" diff --git a/.gitignore b/.gitignore index be4ad8c8..279397fb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,10 @@ .vscode .venv .removed -galvanalyser/protobuf -galvanalyser/webapp/assets/protobuf -libs/galvanalyser-js-protobufs -galvanalyser-protobuf.js +galv/protobuf +galv/webapp/assets/protobuf +libs/galv-js-protobufs +galv-protobuf.js webstack/.env .pnpm-store *.egg-info @@ -28,8 +28,8 @@ backend/backend_django/django_celery_beat.schedulersDatabaseScheduler *.pptx docker-compose.override.yml -backend/backend_django/galvanalyser/migrations/*.py -!backend/backend_django/galvanalyser/migrations/__init__.py +backend/backend_django/galv/migrations/*.py +!backend/backend_django/galv/migrations/__init__.py docs/build/ diff --git a/.worker.env b/.worker.env index fca6dc25..76c58dca 100644 --- a/.worker.env +++ b/.worker.env @@ -1,7 +1,7 @@ # this is the base directory for the harvesters run by the server (note harvesters can # also be setup independently from the server if required, see documentation for # details). New directories added for scanning will be relative to this base directory -GALVANALYSER_HARVESTER_BASE_PATH=/home/mrobins/git/tmp/datafiles +GALV_HARVESTER_BASE_PATH=/home/mrobins/git/tmp/datafiles RABBITMQ_URL=pyamqp://test-user:test-user@rabbitmq:5672 REDIS_URL=redis://:redis@redis:6379 diff --git a/LICENCE b/LICENCE index 78339fff..ad1f7f93 100644 --- a/LICENCE +++ b/LICENCE @@ -1,5 +1,5 @@ Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +of Oxford, and the 'Galv' Developers. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 7d72fb76..61fd8657 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,31 @@ - + -[![Unit Tests (Docker)](https://github.com/Battery-Intelligence-Lab/galvanalyser/actions/workflows/unit-test.yml/badge.svg?branch=main)](https://github.com/Battery-Intelligence-Lab/galvanalyser/actions/workflows/unit-test.yml) -[![Docs](https://github.com/Battery-Intelligence-Lab/galvanalyser/actions/workflows/side-effects.yml/badge.svg?branch=main)](https://github.com/Battery-Intelligence-Lab/galvanalyser/actions/workflows/side-effects.yml) - - [![Docs website](https://github.com/Battery-Intelligence-Lab/galvanalyser/actions/workflows/pages/pages-build-deployment/badge.svg?branch=gh-pages)](https://github.com/Battery-Intelligence-Lab/galvanalyser/actions/workflows/pages/pages-build-deployment) +[![Unit Tests (Docker)](https://github.com/Battery-Intelligence-Lab/galv/actions/workflows/unit-test.yml/badge.svg?branch=main)](https://github.com/Battery-Intelligence-Lab/galv/actions/workflows/unit-test.yml) +[![Docs](https://github.com/Battery-Intelligence-Lab/galv/actions/workflows/side-effects.yml/badge.svg?branch=main)](https://github.com/Battery-Intelligence-Lab/galv/actions/workflows/side-effects.yml) + + [![Docs website](https://github.com/Battery-Intelligence-Lab/galv/actions/workflows/pages/pages-build-deployment/badge.svg?branch=gh-pages)](https://github.com/Battery-Intelligence-Lab/galv/actions/workflows/pages/pages-build-deployment) -Galvanalyser is a system for automatically storing data generated by battery cycling +Galv is a system for automatically storing data generated by battery cycling machines in a database in a standard format. The project contains several distinct components: - A REST API - A Python client for the REST API - A web frontend for the REST API -- [Harvesters](https://Battery-Intelligence-Lab.github.io/galvanalyser/UserGuide.html#harvesters) that monitor and process experimental data +- [Harvesters](https://Battery-Intelligence-Lab.github.io/galv/UserGuide.html#harvesters) that monitor and process experimental data -A laboratory running a [Galvanalyser server](https://Battery-Intelligence-Lab.github.io/galvanalyser/UserGuide.html#galvanalyser-server) instance and a battery -cycling machines can use Galvanalyser to make it easy to access, analyse, and +A laboratory running a [Galv server](https://Battery-Intelligence-Lab.github.io/galv/UserGuide.html#galv-server) instance and a battery +cycling machines can use Galv to make it easy to access, analyse, and share their experimental data. To do this, they: 1. Set the cycling machines up to output their raw test result files to a shared drive. -2. Set up a [harvester](https://Battery-Intelligence-Lab.github.io/galvanalyser/UserGuide.html#harvesters) on a computer with access to that shared drive. +2. Set up a [harvester](https://Battery-Intelligence-Lab.github.io/galv/UserGuide.html#harvesters) on a computer with access to that shared drive. - (This only needs to be done once) -3. Log into their lab [Web frontend](https://Battery-Intelligence-Lab.github.io/galvanalyser/UserGuide.html#web-frontend) and configure the - [harvester](https://Battery-Intelligence-Lab.github.io/galvanalyser/UserGuide.html#harvesters) to crawl the appropriate directories on the shared drive. -4. Log into the [Web frontend](https://Battery-Intelligence-Lab.github.io/galvanalyser/UserGuide.html#web-frontend) to edit metadata and view data, - or use the [Python client](https://Battery-Intelligence-Lab.github.io/galvanalyser/UserGuide.html#python-client) to download formatted data for analysis. +3. Log into their lab [Web frontend](https://Battery-Intelligence-Lab.github.io/galv/UserGuide.html#web-frontend) and configure the + [harvester](https://Battery-Intelligence-Lab.github.io/galv/UserGuide.html#harvesters) to crawl the appropriate directories on the shared drive. +4. Log into the [Web frontend](https://Battery-Intelligence-Lab.github.io/galv/UserGuide.html#web-frontend) to edit metadata and view data, + or use the [Python client](https://Battery-Intelligence-Lab.github.io/galv/UserGuide.html#python-client) to download formatted data for analysis. The harvesters are able to parse the following file types: @@ -36,21 +36,21 @@ The harvesters are able to parse the following file types: The server database is a relational database that stores each dataset along with information about column types, units, and other relevant metadata (e.g. cell information, owner, purpose of the experiment). -The [REST API](https://Battery-Intelligence-Lab.github.io/galvanalyser/UserGuide.html#rest-api) provides its own definition via a downloadable OpenAPI schema file +The [REST API](https://Battery-Intelligence-Lab.github.io/galv/UserGuide.html#rest-api) provides its own definition via a downloadable OpenAPI schema file (`schema/`), and provides interactive documentation via SwaggerUI (`schema/swagger-ui/`) and Redoc (`schema/redoc/`). -The schema can be downloaded from the [documentation page](https://Battery-Intelligence-Lab.github.io/galvanalyser/UserGuide.html#api-spec). +The schema can be downloaded from the [documentation page](https://Battery-Intelligence-Lab.github.io/galv/UserGuide.html#api-spec). A diagram of the logical structure of the system is shown below. The arrows indicate the direction of data flow.
- +
## Project documentation -Full documentation is available at [](https://Battery-Intelligence-Lab.github.io/galvanalyser/), +Full documentation is available at [](https://Battery-Intelligence-Lab.github.io/galv/), build by Sphinx from the source in `./docs/source/*.rst`. diff --git a/backend/Dockerfile b/backend/Dockerfile index c7dd7ec3..4f11d246 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. FROM python:3.10.4-slim@sha256:a2e8240faa44748fe18c5b37f83e14101a38dd3f4a1425d18e9e0e913f89b562 diff --git a/backend/Dockerfile-test b/backend/Dockerfile-test index 8e414362..d8738316 100644 --- a/backend/Dockerfile-test +++ b/backend/Dockerfile-test @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. FROM python:3.10.4-slim@sha256:a2e8240faa44748fe18c5b37f83e14101a38dd3f4a1425d18e9e0e913f89b562 diff --git a/backend/backend_django/config/__init__.py b/backend/backend_django/config/__init__.py index f04e8860..dbe31a5d 100644 --- a/backend/backend_django/config/__init__.py +++ b/backend/backend_django/config/__init__.py @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. -import galvanalyser.schema +import galv.schema diff --git a/backend/backend_django/config/asgi.py b/backend/backend_django/config/asgi.py index b0984b49..086d3012 100644 --- a/backend/backend_django/config/asgi.py +++ b/backend/backend_django/config/asgi.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. """ ASGI config for backend_django project. diff --git a/backend/backend_django/config/settings.py b/backend/backend_django/config/settings.py index f8e8a504..33f9a61a 100644 --- a/backend/backend_django/config/settings.py +++ b/backend/backend_django/config/settings.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import os diff --git a/backend/backend_django/config/settings_dev.py b/backend/backend_django/config/settings_dev.py index 8075594f..ea73be3d 100644 --- a/backend/backend_django/config/settings_dev.py +++ b/backend/backend_django/config/settings_dev.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. """ Django settings for backend_django project. @@ -54,7 +54,7 @@ 'rest_framework', 'django_filters', 'knox', - 'galvanalyser.apps.GalvanalyserConfig', + 'galv.apps.GalvConfig', 'drf_spectacular' ] @@ -101,7 +101,7 @@ 'PORT': os.environ.get('POSTGRES_PORT', 5432), 'USER': 'postgres', 'PASSWORD': os.environ.get('POSTGRES_PASSWORD'), - 'TEST': {'NAME': f"test_galvanalyser"} + 'TEST': {'NAME': f"test_galv"} } } @@ -153,7 +153,7 @@ SESSION_EXPIRE_AT_BROWSER_CLOSE = False REST_FRAMEWORK = { - # 'DEFAULT_PAGINATION_CLASS': 'galvanalyser.pagination.Unpaginatable', + # 'DEFAULT_PAGINATION_CLASS': 'galv.pagination.Unpaginatable', # 'PAGE_SIZE': 10, 'DEFAULT_AUTHENTICATION_CLASSES': [ 'knox.auth.TokenAuthentication', @@ -165,7 +165,7 @@ } REST_KNOX = { 'SECURE_HASH_ALGORITHM': 'cryptography.hazmat.primitives.hashes.SHA512', - 'USER_SERIALIZER': 'galvanalyser.serializers.UserSerializer', + 'USER_SERIALIZER': 'galv.serializers.UserSerializer', 'AUTO_REFRESH': True, 'AUTH_HEADER_PREFIX': 'Bearer', 'TOKEN_LIMIT_PER_USER': 20 diff --git a/backend/backend_django/config/settings_prod.py b/backend/backend_django/config/settings_prod.py index 03f077d1..19f1f5e6 100644 --- a/backend/backend_django/config/settings_prod.py +++ b/backend/backend_django/config/settings_prod.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. """ Django settings for backend_django project. @@ -62,7 +62,7 @@ 'rest_framework', 'django_filters', 'knox', - 'galvanalyser.apps.GalvanalyserConfig', + 'galv.apps.GalvConfig', 'drf_spectacular', ] @@ -109,7 +109,7 @@ 'PORT': os.environ.get('POSTGRES_PORT', 5432), 'USER': 'postgres', 'PASSWORD': os.environ.get('POSTGRES_PASSWORD'), - 'TEST': {'NAME': f"test_galvanalyser"} + 'TEST': {'NAME': f"test_galv"} } } @@ -160,7 +160,7 @@ SESSION_EXPIRE_AT_BROWSER_CLOSE = False REST_FRAMEWORK = { - # 'DEFAULT_PAGINATION_CLASS': 'galvanalyser.pagination.Unpaginatable', + # 'DEFAULT_PAGINATION_CLASS': 'galv.pagination.Unpaginatable', # 'PAGE_SIZE': 10, 'DEFAULT_AUTHENTICATION_CLASSES': [ 'knox.auth.TokenAuthentication', @@ -172,7 +172,7 @@ } REST_KNOX = { 'SECURE_HASH_ALGORITHM': 'cryptography.hazmat.primitives.hashes.SHA512', - 'USER_SERIALIZER': 'galvanalyser.serializers.UserSerializer', + 'USER_SERIALIZER': 'galv.serializers.UserSerializer', 'AUTO_REFRESH': True, 'AUTH_HEADER_PREFIX': 'Bearer', 'TOKEN_LIMIT_PER_USER': 20 diff --git a/backend/backend_django/config/urls.py b/backend/backend_django/config/urls.py index 265841ed..ca029aec 100644 --- a/backend/backend_django/config/urls.py +++ b/backend/backend_django/config/urls.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. """backend_django URL Configuration @@ -21,7 +21,7 @@ from django.urls import include, path from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView from rest_framework import routers -from galvanalyser import views +from galv import views router = routers.DefaultRouter() diff --git a/backend/backend_django/config/wsgi.py b/backend/backend_django/config/wsgi.py index ef5f8506..bc601cb9 100644 --- a/backend/backend_django/config/wsgi.py +++ b/backend/backend_django/config/wsgi.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. """ WSGI config for backend_django project. diff --git a/backend/backend_django/galvanalyser/__init__.py b/backend/backend_django/galv/__init__.py similarity index 100% rename from backend/backend_django/galvanalyser/__init__.py rename to backend/backend_django/galv/__init__.py diff --git a/backend/backend_django/galvanalyser/admin.py b/backend/backend_django/galv/admin.py similarity index 73% rename from backend/backend_django/galvanalyser/admin.py rename to backend/backend_django/galv/admin.py index 621b8c0e..38dc0f80 100644 --- a/backend/backend_django/galvanalyser/admin.py +++ b/backend/backend_django/galv/admin.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. from django.contrib import admin diff --git a/backend/backend_django/galvanalyser/apps.py b/backend/backend_django/galv/apps.py similarity index 62% rename from backend/backend_django/galvanalyser/apps.py rename to backend/backend_django/galv/apps.py index e57ec194..42a32493 100644 --- a/backend/backend_django/galvanalyser/apps.py +++ b/backend/backend_django/galv/apps.py @@ -1,10 +1,10 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. from django.apps import AppConfig -class GalvanalyserConfig(AppConfig): +class GalvConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' - name = 'galvanalyser' + name = 'galv' diff --git a/backend/backend_django/galvanalyser/fixtures/DataColumnType.json b/backend/backend_django/galv/fixtures/DataColumnType.json similarity index 81% rename from backend/backend_django/galvanalyser/fixtures/DataColumnType.json rename to backend/backend_django/galv/fixtures/DataColumnType.json index 5eaf9cf7..fd1b3ada 100644 --- a/backend/backend_django/galvanalyser/fixtures/DataColumnType.json +++ b/backend/backend_django/galv/fixtures/DataColumnType.json @@ -1,7 +1,7 @@ [ { "pk": 1, - "model": "galvanalyser.DataColumnType", + "model": "galv.DataColumnType", "fields": { "name": "Unknown", "description": "unknown column type", @@ -10,7 +10,7 @@ }, { "pk": 2, - "model": "galvanalyser.DataColumnType", + "model": "galv.DataColumnType", "fields": { "name": "Sample Number", "description": "The sample or record number. Is increased by one each time a test machine records a reading. Usually counts from 1 at the start of a test", @@ -20,7 +20,7 @@ }, { "pk": 3, - "model": "galvanalyser.DataColumnType", + "model": "galv.DataColumnType", "fields": { "name": "Time", "description": "The time in seconds since the test run began.", @@ -30,7 +30,7 @@ }, { "pk": 4, - "model": "galvanalyser.DataColumnType", + "model": "galv.DataColumnType", "fields": { "name": "Volts", "description": "The voltage of the cell.", @@ -40,7 +40,7 @@ }, { "pk": 5, - "model": "galvanalyser.DataColumnType", + "model": "galv.DataColumnType", "fields": { "name": "Amps", "description": "The current current.", @@ -50,7 +50,7 @@ }, { "pk": 6, - "model": "galvanalyser.DataColumnType", + "model": "galv.DataColumnType", "fields": { "name": "Energy Capacity", "description": "The Energy Capacity.", @@ -60,7 +60,7 @@ }, { "pk": 7, - "model": "galvanalyser.DataColumnType", + "model": "galv.DataColumnType", "fields": { "name": "Charge Capacity", "description": "The Charge Capacity.", @@ -70,7 +70,7 @@ }, { "pk": 8, - "model": "galvanalyser.DataColumnType", + "model": "galv.DataColumnType", "fields": { "name": "Temperature", "description": "The temperature.", @@ -80,7 +80,7 @@ }, { "pk": 9, - "model": "galvanalyser.DataColumnType", + "model": "galv.DataColumnType", "fields": { "name": "Step Time", "description": "The time in seconds since the current step began.", @@ -90,7 +90,7 @@ }, { "pk": 10, - "model": "galvanalyser.DataColumnType", + "model": "galv.DataColumnType", "fields": { "name": "Impedence Magnitude", "description": "The magnitude of the impedence (EIS).", @@ -100,7 +100,7 @@ }, { "pk": 11, - "model": "galvanalyser.DataColumnType", + "model": "galv.DataColumnType", "fields": { "name": "Impedence Phase", "description": "The phase of the impedence (EIS).", @@ -110,7 +110,7 @@ }, { "pk": 12, - "model": "galvanalyser.DataColumnType", + "model": "galv.DataColumnType", "fields": { "name": "Frequency", "description": "The frequency of the input EIS voltage signal.", diff --git a/backend/backend_django/galvanalyser/fixtures/DataUnit.json b/backend/backend_django/galv/fixtures/DataUnit.json similarity index 82% rename from backend/backend_django/galvanalyser/fixtures/DataUnit.json rename to backend/backend_django/galv/fixtures/DataUnit.json index 4cae6939..b9d7a376 100644 --- a/backend/backend_django/galvanalyser/fixtures/DataUnit.json +++ b/backend/backend_django/galv/fixtures/DataUnit.json @@ -1,7 +1,7 @@ [ { "pk": 1, - "model": "galvanalyser.DataUnit", + "model": "galv.DataUnit", "fields": { "name": "Unitless", "symbol": "", @@ -11,7 +11,7 @@ }, { "pk": 2, - "model": "galvanalyser.DataUnit", + "model": "galv.DataUnit", "fields": { "name": "Time", "symbol": "s", @@ -21,7 +21,7 @@ }, { "pk": 3, - "model": "galvanalyser.DataUnit", + "model": "galv.DataUnit", "fields": { "name": "Volts", "symbol": "V", @@ -31,7 +31,7 @@ }, { "pk": 4, - "model": "galvanalyser.DataUnit", + "model": "galv.DataUnit", "fields": { "name": "Amps", "symbol": "A", @@ -41,7 +41,7 @@ }, { "pk": 5, - "model": "galvanalyser.DataUnit", + "model": "galv.DataUnit", "fields": { "name": "Energy", "symbol": "Wh", @@ -51,7 +51,7 @@ }, { "pk": 6, - "model": "galvanalyser.DataUnit", + "model": "galv.DataUnit", "fields": { "name": "Charge", "symbol": "Ah", @@ -61,7 +61,7 @@ }, { "pk": 7, - "model": "galvanalyser.DataUnit", + "model": "galv.DataUnit", "fields": { "name": "Temperature", "symbol": "°c", @@ -71,7 +71,7 @@ }, { "pk": 8, - "model": "galvanalyser.DataUnit", + "model": "galv.DataUnit", "fields": { "name": "Power", "symbol": "W", @@ -81,7 +81,7 @@ }, { "pk": 9, - "model": "galvanalyser.DataUnit", + "model": "galv.DataUnit", "fields": { "name": "Ohm", "symbol": "Ω", @@ -91,7 +91,7 @@ }, { "pk": 10, - "model": "galvanalyser.DataUnit", + "model": "galv.DataUnit", "fields": { "name": "Degrees", "symbol": "°", @@ -101,7 +101,7 @@ }, { "pk": 11, - "model": "galvanalyser.DataUnit", + "model": "galv.DataUnit", "fields": { "name": "Frequency", "symbol": "Hz", diff --git a/backend/backend_django/galvanalyser/management/__init__.py b/backend/backend_django/galv/management/__init__.py similarity index 100% rename from backend/backend_django/galvanalyser/management/__init__.py rename to backend/backend_django/galv/management/__init__.py diff --git a/backend/backend_django/galvanalyser/management/commands/__init__.py b/backend/backend_django/galv/management/commands/__init__.py similarity index 100% rename from backend/backend_django/galvanalyser/management/commands/__init__.py rename to backend/backend_django/galv/management/commands/__init__.py diff --git a/backend/backend_django/galvanalyser/management/commands/create_superuser.py b/backend/backend_django/galv/management/commands/create_superuser.py similarity index 94% rename from backend/backend_django/galvanalyser/management/commands/create_superuser.py rename to backend/backend_django/galv/management/commands/create_superuser.py index cf8c0dfc..3c0fd808 100644 --- a/backend/backend_django/galvanalyser/management/commands/create_superuser.py +++ b/backend/backend_django/galv/management/commands/create_superuser.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. from django.core.management.base import BaseCommand from django.contrib.auth.models import User diff --git a/backend/backend_django/galvanalyser/management/commands/init_db.py b/backend/backend_django/galv/management/commands/init_db.py similarity index 86% rename from backend/backend_django/galvanalyser/management/commands/init_db.py rename to backend/backend_django/galv/management/commands/init_db.py index c75d542c..5a950d16 100644 --- a/backend/backend_django/galvanalyser/management/commands/init_db.py +++ b/backend/backend_django/galv/management/commands/init_db.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. from django.core.management.base import BaseCommand from django.db import connection @@ -19,7 +19,7 @@ def handle(self, *args, **options): value double precision NOT NULL, PRIMARY KEY (sample, column_id), FOREIGN KEY (column_id) - REFERENCES "galvanalyser_datacolumn" (id) MATCH SIMPLE + REFERENCES "galv_datacolumn" (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE RESTRICT ) WITH (OIDS = FALSE) diff --git a/backend/backend_django/galvanalyser/migrations/__init__.py b/backend/backend_django/galv/migrations/__init__.py similarity index 100% rename from backend/backend_django/galvanalyser/migrations/__init__.py rename to backend/backend_django/galv/migrations/__init__.py diff --git a/backend/backend_django/galvanalyser/models.py b/backend/backend_django/galv/models.py similarity index 99% rename from backend/backend_django/galvanalyser/models.py rename to backend/backend_django/galv/models.py index fa08610c..0627e7df 100644 --- a/backend/backend_django/galvanalyser/models.py +++ b/backend/backend_django/galv/models.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. from typing import Type from django.contrib.postgres.fields import ArrayField diff --git a/backend/backend_django/galvanalyser/pagination.py b/backend/backend_django/galv/pagination.py similarity index 91% rename from backend/backend_django/galvanalyser/pagination.py rename to backend/backend_django/galv/pagination.py index f080570e..5fbbf187 100644 --- a/backend/backend_django/galvanalyser/pagination.py +++ b/backend/backend_django/galv/pagination.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. from rest_framework.pagination import PageNumberPagination, BasePagination diff --git a/backend/backend_django/galvanalyser/permissions.py b/backend/backend_django/galv/permissions.py similarity index 96% rename from backend/backend_django/galvanalyser/permissions.py rename to backend/backend_django/galv/permissions.py index 8d61ad21..ba58485c 100644 --- a/backend/backend_django/galvanalyser/permissions.py +++ b/backend/backend_django/galv/permissions.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. from django.db.models import Q from rest_framework import permissions diff --git a/backend/backend_django/galvanalyser/schema.py b/backend/backend_django/galv/schema.py similarity index 92% rename from backend/backend_django/galvanalyser/schema.py rename to backend/backend_django/galv/schema.py index 054e928c..35082cd1 100644 --- a/backend/backend_django/galvanalyser/schema.py +++ b/backend/backend_django/galv/schema.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. from drf_spectacular.extensions import OpenApiAuthenticationExtension from knox.settings import knox_settings diff --git a/backend/backend_django/galvanalyser/serializers.py b/backend/backend_django/galv/serializers.py similarity index 99% rename from backend/backend_django/galvanalyser/serializers.py rename to backend/backend_django/galv/serializers.py index cc513a65..4d8b1028 100644 --- a/backend/backend_django/galvanalyser/serializers.py +++ b/backend/backend_django/galv/serializers.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import os.path import re diff --git a/backend/backend_django/galvanalyser/tests/__init__.py b/backend/backend_django/galv/tests/__init__.py similarity index 100% rename from backend/backend_django/galvanalyser/tests/__init__.py rename to backend/backend_django/galv/tests/__init__.py diff --git a/backend/backend_django/galvanalyser/tests/factories.py b/backend/backend_django/galv/tests/factories.py similarity index 97% rename from backend/backend_django/galvanalyser/tests/factories.py rename to backend/backend_django/galv/tests/factories.py index ab89a2ef..cf80aeb9 100644 --- a/backend/backend_django/galvanalyser/tests/factories.py +++ b/backend/backend_django/galv/tests/factories.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import os @@ -8,7 +8,7 @@ import faker import django.conf.global_settings from django.utils import timezone -from galvanalyser.models import Harvester, \ +from galv.models import Harvester, \ HarvestError, \ MonitoredPath, \ ObservedFile, \ diff --git a/backend/backend_django/galvanalyser/tests/test_api_tokens.py b/backend/backend_django/galv/tests/test_api_tokens.py similarity index 91% rename from backend/backend_django/galvanalyser/tests/test_api_tokens.py rename to backend/backend_django/galv/tests/test_api_tokens.py index 1336e084..ba188c03 100644 --- a/backend/backend_django/galvanalyser/tests/test_api_tokens.py +++ b/backend/backend_django/galv/tests/test_api_tokens.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import unittest from django.urls import reverse @@ -8,16 +8,16 @@ from rest_framework.test import APITestCase import logging -from galvanalyser.models import KnoxAuthToken +from galv.models import KnoxAuthToken -from .utils import GalvanalyserTestCase +from .utils import GalvTestCase from .factories import UserFactory logger = logging.getLogger(__file__) logger.setLevel(logging.INFO) -class TokenTests(GalvanalyserTestCase): +class TokenTests(GalvTestCase): def setUp(self): self.user = UserFactory.create(username='test_user') self.other_user = UserFactory.create(username='test_user_other') diff --git a/backend/backend_django/galvanalyser/tests/test_view_cells.py b/backend/backend_django/galv/tests/test_view_cells.py similarity index 95% rename from backend/backend_django/galvanalyser/tests/test_view_cells.py rename to backend/backend_django/galv/tests/test_view_cells.py index 8bff6522..6caecf70 100644 --- a/backend/backend_django/galvanalyser/tests/test_view_cells.py +++ b/backend/backend_django/galv/tests/test_view_cells.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import unittest from django.urls import reverse @@ -9,7 +9,7 @@ import logging from .factories import CellFamilyFactory, CellFactory -from galvanalyser.models import CellFamily, Cell +from galv.models import CellFamily, Cell logger = logging.getLogger(__file__) logger.setLevel(logging.INFO) diff --git a/backend/backend_django/galvanalyser/tests/test_view_datasets.py b/backend/backend_django/galv/tests/test_view_datasets.py similarity index 95% rename from backend/backend_django/galvanalyser/tests/test_view_datasets.py rename to backend/backend_django/galv/tests/test_view_datasets.py index e4f96bdd..e50bd2bb 100644 --- a/backend/backend_django/galvanalyser/tests/test_view_datasets.py +++ b/backend/backend_django/galv/tests/test_view_datasets.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import unittest from django.urls import reverse diff --git a/backend/backend_django/galvanalyser/tests/test_view_equipment.py b/backend/backend_django/galv/tests/test_view_equipment.py similarity index 91% rename from backend/backend_django/galvanalyser/tests/test_view_equipment.py rename to backend/backend_django/galv/tests/test_view_equipment.py index 3cad5540..6d43e112 100644 --- a/backend/backend_django/galvanalyser/tests/test_view_equipment.py +++ b/backend/backend_django/galv/tests/test_view_equipment.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import unittest from django.urls import reverse @@ -9,7 +9,7 @@ import logging from .factories import EquipmentFactory -from galvanalyser.models import Equipment +from galv.models import Equipment logger = logging.getLogger(__file__) logger.setLevel(logging.INFO) diff --git a/backend/backend_django/galvanalyser/tests/test_view_files.py b/backend/backend_django/galv/tests/test_view_files.py similarity index 94% rename from backend/backend_django/galvanalyser/tests/test_view_files.py rename to backend/backend_django/galv/tests/test_view_files.py index e5359f81..36ca4abd 100644 --- a/backend/backend_django/galvanalyser/tests/test_view_files.py +++ b/backend/backend_django/galv/tests/test_view_files.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import unittest from django.urls import reverse @@ -12,7 +12,7 @@ HarvesterFactory, \ MonitoredPathFactory, \ ObservedFileFactory -from galvanalyser.models import ObservedFile, \ +from galv.models import ObservedFile, \ FileState logger = logging.getLogger(__file__) diff --git a/backend/backend_django/galvanalyser/tests/test_view_harvester.py b/backend/backend_django/galv/tests/test_view_harvester.py similarity index 98% rename from backend/backend_django/galvanalyser/tests/test_view_harvester.py rename to backend/backend_django/galv/tests/test_view_harvester.py index acf5e1b6..d20777a2 100644 --- a/backend/backend_django/galvanalyser/tests/test_view_harvester.py +++ b/backend/backend_django/galv/tests/test_view_harvester.py @@ -1,17 +1,17 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import unittest from django.urls import reverse from rest_framework import status import logging -from .utils import GalvanalyserTestCase +from .utils import GalvTestCase from .factories import UserFactory, \ HarvesterFactory, \ MonitoredPathFactory -from galvanalyser.models import Harvester, \ +from galv.models import Harvester, \ HarvesterEnvVar, \ HarvestError, \ MonitoredPath, \ @@ -23,7 +23,7 @@ logger.setLevel(logging.INFO) -class HarvesterTests(GalvanalyserTestCase): +class HarvesterTests(GalvTestCase): def test_create(self): url = reverse('harvester-list') user_id = 1 diff --git a/backend/backend_django/galvanalyser/tests/test_view_path.py b/backend/backend_django/galv/tests/test_view_path.py similarity index 96% rename from backend/backend_django/galvanalyser/tests/test_view_path.py rename to backend/backend_django/galv/tests/test_view_path.py index d9210e84..c9b40384 100644 --- a/backend/backend_django/galvanalyser/tests/test_view_path.py +++ b/backend/backend_django/galv/tests/test_view_path.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import json import unittest from django.urls import reverse @@ -11,7 +11,7 @@ from .factories import UserFactory, \ HarvesterFactory, \ MonitoredPathFactory -from galvanalyser.models import Harvester, \ +from galv.models import Harvester, \ MonitoredPath logger = logging.getLogger(__file__) diff --git a/backend/backend_django/galvanalyser/tests/test_view_user.py b/backend/backend_django/galv/tests/test_view_user.py similarity index 98% rename from backend/backend_django/galvanalyser/tests/test_view_user.py rename to backend/backend_django/galv/tests/test_view_user.py index 442c6639..cda598d1 100644 --- a/backend/backend_django/galvanalyser/tests/test_view_user.py +++ b/backend/backend_django/galv/tests/test_view_user.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import unittest from django.urls import reverse @@ -10,7 +10,7 @@ import base64 from .factories import UserFactory -from galvanalyser.models import VouchFor +from galv.models import VouchFor from django.contrib.auth.models import User logger = logging.getLogger(__file__) diff --git a/backend/backend_django/galvanalyser/tests/utils.py b/backend/backend_django/galv/tests/utils.py similarity index 86% rename from backend/backend_django/galvanalyser/tests/utils.py rename to backend/backend_django/galv/tests/utils.py index 20a21bee..54ce4b1b 100644 --- a/backend/backend_django/galvanalyser/tests/utils.py +++ b/backend/backend_django/galv/tests/utils.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import base64 @@ -8,7 +8,7 @@ from rest_framework.test import APITestCase -class GalvanalyserTestCase(APITestCase): +class GalvTestCase(APITestCase): def get_token_header_for_user(self, user): self.client.force_login(user) diff --git a/backend/backend_django/galvanalyser/utils.py b/backend/backend_django/galv/utils.py similarity index 96% rename from backend/backend_django/galvanalyser/utils.py rename to backend/backend_django/galv/utils.py index e77efa44..196f89cb 100644 --- a/backend/backend_django/galvanalyser/utils.py +++ b/backend/backend_django/galv/utils.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import io import sys diff --git a/backend/backend_django/galvanalyser/views.py b/backend/backend_django/galv/views.py similarity index 98% rename from backend/backend_django/galvanalyser/views.py rename to backend/backend_django/galv/views.py index ac58438d..5d2d0e17 100644 --- a/backend/backend_django/galvanalyser/views.py +++ b/backend/backend_django/galv/views.py @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. import datetime @@ -379,7 +379,7 @@ class HarvesterViewSet(viewsets.ModelViewSet): When Harvesters communicate with the API they do so using special Harvester API Keys. These provide access to the report and configuration endpoints. - Harvesters are created by a separate software package available within Galvanalyser. + Harvesters are created by a separate software package available within Galv. """ permission_classes = [HarvesterAccess] filterset_fields = ['name'] @@ -624,7 +624,7 @@ def report(self, request, pk: int = None): description=""" A Path refers to a directory accessible by a Harvester in which data files will reside. Those files will be scanned periodically by the Harvester, -becoming ObservedFiles once they are reported to Galvanalyser by the Harvester. +becoming ObservedFiles once they are reported to Galv by the Harvester. Paths can be created or updated by a Harvester's admins and users, as well as any users who have been given explicit permissions to edit the MonitoredPath. @@ -638,7 +638,7 @@ def report(self, request, pk: int = None): description=""" A Path refers to a directory accessible by a Harvester in which data files will reside. Those files will be scanned periodically by the Harvester, -becoming ObservedFiles once they are reported to Galvanalyser by the Harvester. +becoming ObservedFiles once they are reported to Galv by the Harvester. """ ), create=extend_schema( @@ -646,7 +646,7 @@ def report(self, request, pk: int = None): description=""" Register a new directory on for a Harvester to crawl. Files in that directory will be scanned periodically by the Harvester, -becoming ObservedFiles once they are reported to Galvanalyser by the Harvester. +becoming ObservedFiles once they are reported to Galv by the Harvester. """, request=MonitoredPathCreateSerializer(), responses={ @@ -672,7 +672,7 @@ class MonitoredPathViewSet(viewsets.ModelViewSet): """ A MonitoredPath refers to a directory accessible by a Harvester in which data files will reside. Those files will be scanned periodically by the Harvester, - becoming ObservedFiles once they are reported to Galvanalyser by the Harvester. + becoming ObservedFiles once they are reported to Galv by the Harvester. MonitoredPaths can be created or updated by a Harvester's admins and users, as well as any users who have been given explicit permissions to edit the MonitoredPath. @@ -702,7 +702,7 @@ def get_queryset(self): description=""" Files are files in a directory marked as a monitored Path for a Harvester. -They are reported to Galvanalyser by the harvester program. +They are reported to Galv by the harvester program. An File will have file metadata (size, modification time), and a status representing its import state. It may be linked to HarvestErrors encountered while importing the file, and/or to Datasets representing the content @@ -740,7 +740,7 @@ def get_queryset(self): class ObservedFileViewSet(viewsets.ModelViewSet): """ ObservedFiles are files that exist (or have existed) in a MonitoredPath and have - been reported to Galvanalyser by the Harvester. + been reported to Galv by the Harvester. An ObservedFile instance will have file metadata (size, modification time), and a status representing its import state. It may be linked to HarvestErrors @@ -807,7 +807,7 @@ class DatasetViewSet(viewsets.ModelViewSet): """ A Dataset contains structured data from an ObservedFile. - Datasets are decomposed within Galvanalyser into columns and datapoints, + Datasets are decomposed within Galv into columns and datapoints, providing an ability flexibly handle any kind of tabular data. """ serializer_class = DatasetSerializer @@ -1061,7 +1061,7 @@ class DataUnitViewSet(viewsets.ReadOnlyModelViewSet): Column Types are generic Column templates. They hold the metadata for a Column, while the individual Column instances link Column Types to the TimeseriesData they contain. -Some Column Types are innately recognised by Galvanalyser and its harvester parsers, +Some Column Types are innately recognised by Galv and its harvester parsers, while others can be defined by the parsers during data processing. Searchable fields: @@ -1075,7 +1075,7 @@ class DataUnitViewSet(viewsets.ReadOnlyModelViewSet): Column Types are generic Column templates. They hold the metadata for a Column, while the individual Column instances link Column Types to the TimeseriesData they contain. -Some Column Types are innately recognised by Galvanalyser and its harvester parsers, +Some Column Types are innately recognised by Galv and its harvester parsers, while others can be defined by the parsers during data processing. Searchable fields: diff --git a/backend/backend_django/manage.py b/backend/backend_django/manage.py index dad979f9..e0abe3ca 100644 --- a/backend/backend_django/manage.py +++ b/backend/backend_django/manage.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. """Django's command-line utility for administrative tasks.""" import os diff --git a/backend/server.sh b/backend/server.sh index 596722f5..fe76146a 100755 --- a/backend/server.sh +++ b/backend/server.sh @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. # init.sh @@ -18,7 +18,7 @@ python manage.py collectstatic --noinput >&2 echo "Waiting for Postgres to start" while [ $PGUP -ne 0 ]; do - pg_isready -d "postgresql://postgres:galvanalyser@${POSTGRES_HOST:-postgres}:${POSTGRES_PORT:-5432}/postgres" + pg_isready -d "postgresql://postgres:galv@${POSTGRES_HOST:-postgres}:${POSTGRES_PORT:-5432}/postgres" PGUP=$? >&2 echo "Postgres is unavailable - sleeping" sleep 1 @@ -33,8 +33,8 @@ python manage.py init_db python manage.py create_superuser >&2 echo "... populating database" -python manage.py loaddata galvanalyser/fixtures/DataUnit.json -python manage.py loaddata galvanalyser/fixtures/DataColumnType.json +python manage.py loaddata galv/fixtures/DataUnit.json +python manage.py loaddata galv/fixtures/DataColumnType.json >&2 echo "Initialisation complete - starting server" diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index e631a0de..0f199246 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. version: "2" services: @@ -13,7 +13,7 @@ services: volumes: - ./harvester:/usr/harvester - ./.harvester:/harvester_files - - "${GALVANALYSER_HARVESTER_TEST_PATH}:/usr/test_data" + - "${GALV_HARVESTER_TEST_PATH}:/usr/test_data" working_dir: /usr/harvester restart: unless-stopped command: python start.py --name "harvey" --url http://app/ --user_id 1 --run_foreground --restart @@ -59,8 +59,8 @@ services: # - postgres # volumes: # - ./backend:/usr/app -# - "${GALVANALYSER_HARVESTER_BASE_PATH}:/usr/data" -# - "${GALVANALYSER_HARVESTER_TEST_PATH}:/usr/test_data" +# - "${GALV_HARVESTER_BASE_PATH}:/usr/data" +# - "${GALV_HARVESTER_TEST_PATH}:/usr/test_data" # - "${CELERY_LOG_DIR}:/var/log/celery" # working_dir: /usr/app # env_file: diff --git a/docker-compose.docs.yml b/docker-compose.docs.yml index fa4698c4..423b3367 100644 --- a/docker-compose.docs.yml +++ b/docker-compose.docs.yml @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. # Docker-compose file for the containers that generate documentation artefacts. # Should allow generation of @@ -34,7 +34,7 @@ services: image: "postgres" stop_signal: SIGINT # Fast Shutdown mode volumes: - - "${GALVANALYSER_DATA_PATH}:/var/lib/postgresql/data" + - "${GALV_DATA_PATH}:/var/lib/postgresql/data" env_file: - ./.env - ./.env.secret diff --git a/docker-compose.harvester.yml b/docker-compose.harvester.yml index 9f8fcf81..3021c023 100644 --- a/docker-compose.harvester.yml +++ b/docker-compose.harvester.yml @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. version: "2" services: diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 205fe56b..c5055d87 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. version: "2" services: @@ -9,7 +9,7 @@ services: image: "postgres" stop_signal: SIGINT # Fast Shutdown mode volumes: - - "${GALVANALYSER_DATA_PATH}:/var/lib/postgresql/data" + - "${GALV_DATA_PATH}:/var/lib/postgresql/data" env_file: - .env.secret restart: unless-stopped @@ -38,7 +38,7 @@ services: volumes: - ./harvester:/usr/harvester - ./.harvester:/harvester_files - - "${GALVANALYSER_HARVESTER_TEST_PATH}:/usr/test_data" + - "${GALV_HARVESTER_TEST_PATH}:/usr/test_data" working_dir: /usr command: python -m unittest discover -s /usr/harvester/test diff --git a/docker-compose.yml b/docker-compose.yml index d5d18d12..d8b93794 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University -# of Oxford, and the 'Galvanalyser' Developers. All rights reserved. +# of Oxford, and the 'Galv' Developers. All rights reserved. # docker-compose automatically loads contents of .env so we can refer to those here @@ -46,7 +46,7 @@ services: image: "postgres" stop_signal: SIGINT # Fast Shutdown mode volumes: - - "${GALVANALYSER_DATA_PATH}:/var/lib/postgresql/data" + - "${GALV_DATA_PATH}:/var/lib/postgresql/data" env_file: - ./.env - ./.env.secret diff --git a/docs/source/DevelopmentGuide.rst b/docs/source/DevelopmentGuide.rst index b4bae5a6..0b106c40 100644 --- a/docs/source/DevelopmentGuide.rst +++ b/docs/source/DevelopmentGuide.rst @@ -21,7 +21,7 @@ Below is a tree diagram of the folder structure of this project and a short desc | │ ├ requirements-test.txt -- Additional Python libraries required for unit testing | │ ├ server.sh -- Initilisation shell script (waits on database, then launches Django) | │ ├ config/ -- Django configuration files -| │ ├ galvanalyser/ -- Django application +| │ ├ galv/ -- Django application | │ └ tests/ -- unit tests for backend | ├ docs/ -- documentation | ├ frontend/ -- The react frontend code @@ -77,7 +77,7 @@ Harvester unit tests ================================================================================ The test-suite runs over a set of battery tester files in the directory specified by -``GALVANALYSER_HARVESTER_TEST_PATH``. +``GALV_HARVESTER_TEST_PATH``. To access the test-suite, contact Martin who can provide the necessary credentials to acquire the files from the remote repository. @@ -153,41 +153,41 @@ There are tweaks to the basic Django systems for: * providing an unmanaged database table for Timeseries data - * table created in ``backend/backend_django/galvanalyser/management/commands/init_db.py`` + * table created in ``backend/backend_django/galv/management/commands/init_db.py`` * called in ``backend/server.sh`` - * unmanaged model included in ``backend/backend_django/galvanalyser/models.py`` + * unmanaged model included in ``backend/backend_django/galv/models.py`` * prefilling the database with default columns and units - * ``backend/backend_django/galvanalyser/fixtures/`` contains fixture files + * ``backend/backend_django/galv/fixtures/`` contains fixture files * loaded in ``backend/server.sh`` * creating superuser account - * created by ``backend/backend_django/galvanalyser/management/commands/create_superuser.py`` + * created by ``backend/backend_django/galv/management/commands/create_superuser.py`` * called in ``backend/server.sh`` * configuration via ``.env.secret``'s ``DJANGO_SUPERUSER_PASSWORD`` entry * providing custom permission mechanisms for Harvesters and Cell/Cell Family/Equipment - * code in ``backend/backend_django/galvanalyser/permissions.py`` + * code in ``backend/backend_django/galv/permissions.py`` - * used in ``backend/backend_django/galvanalyser/views.py`` + * used in ``backend/backend_django/galv/views.py`` * extending ``drf-spectacular`` to play nicely with ``django-rest-knox`` - * code in ``backend/backend_django/galvanalyser/schema.py`` + * code in ``backend/backend_django/galv/schema.py`` * providing a mechanism for yielding data rapidly into the database via SQL's COPY directive - * code in ``backend/backend_django/galvanalyser/utils.py`` + * code in ``backend/backend_django/galv/utils.py`` Additionally, there are some tricks here and there in -``backend/backend_django/galvanalyser/serializers.py`` and -``backend/backend_django/galvanalyser/models.py``. +``backend/backend_django/galv/serializers.py`` and +``backend/backend_django/galv/models.py``. It's hard to say what's counterintuitive off the bat, however, so if something confuses you and you figure it out, please document it here! diff --git a/docs/source/FirstTimeQuickSetup.rst b/docs/source/FirstTimeQuickSetup.rst index 7ad34c6a..1054af4c 100644 --- a/docs/source/FirstTimeQuickSetup.rst +++ b/docs/source/FirstTimeQuickSetup.rst @@ -27,27 +27,27 @@ Installation instructions for ``git`` for all major OSs can be found `here