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.schedulersDatabaseScheduler *.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.

- Data flows from battery cycling machines to Galvanalyser Harvesters, then to the     Galvanalyser server and REST API. Metadata can be updated and data read using the web client, and data can be downloaded by the Python client. + Data flows from battery cycling machines to Galv Harvesters, then to the     Galv server and REST API. Metadata can be updated and data read using the web client, and data can be downloaded by the Python client.

## 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 `_. -Get the galvanalyser source code +Get the galv source code ======================================================================================= -First you will need to clone the galvanalyser repository using ``git``: +First you will need to clone the galv repository using ``git``: .. code-block:: bash - git clone https://gitlab.com/battery-intelligence-lab/galvanalyser-project/galvanalyser.git - cd galvanalyser + git clone https://gitlab.com/battery-intelligence-lab/galv-project/galv.git + cd galv Setup environment variables ======================================================================================= -The Galvanalyser project uses two ``.env`` files, ``.env`` and ``.env.secret``. +The Galv project uses two ``.env`` files, ``.env`` and ``.env.secret``. You will already have a ``.env`` file in the repository you cloned, with sensible defaults. If you're running a **production deployment**, you will want to set the value of the ``VIRTUAL_HOST_ROOT`` to your domain name, e.g. ``VIRTUAL_HOST_ROOT=example.com``. -This will serve the Galvanalyser web application from the root of your domain, +This will serve the Galv web application from the root of your domain, e.g. at ``http://example.com/``; and the API from the subdomain, e.g. ``http://api.example.com``. You will likely also want to enable HTTPS, for which we use LetsEncrypt to generate SSL certificates. By default, the staging (test) server is used, which generates certificates that are not trusted by browsers. @@ -55,7 +55,7 @@ When your production setup appears to work correctly, you can switch to fetching by setting ``LETSENCRYPT_TEST=false`` and restarting the nginx-proxy container. If you wish to change where the database is saved, you can change the first entry -in ``.env``, ``GALVANALYSER_DATA_PATH`` to the directory where you want the postgres database. +in ``.env``, ``GALV_DATA_PATH`` to the directory where you want the postgres database. Create ``.env.secret`` ======================================================================================= @@ -83,10 +83,10 @@ you can also specify DJANGO_SUPERUSER_USERNAME. vi .env.secret # could also use nano, emacs, etc. -Build docker images (only when upgrading to a new version of galvanalyser) +Build docker images (only when upgrading to a new version of galv) ======================================================================================= -If you have previously installed and run galvanalyser you might already have old docker +If you have previously installed and run galv you might already have old docker images already built. To rebuild the images, run the following command: .. code-block:: bash @@ -94,10 +94,10 @@ images already built. To rebuild the images, run the following command: docker-compose build ************************************************************************************** -Running Galvanalyser +Running Galv ************************************************************************************** -You can run the galvanalyser server and web application frontend using the following +You can run the galv server and web application frontend using the following ``docker-compose`` command from the root folder of the repository. .. code-block:: bash @@ -105,7 +105,7 @@ You can run the galvanalyser server and web application frontend using the follo docker-compose up Now view the 'localhost' IP address `http://127.0.0.1/ `_ in your -browser and you should see the Galvanalyser login page. +browser and you should see the Galv login page. This is the web frontend. If you wish to use the frontend from another machine, use the IP address or URL of the server instead. @@ -126,16 +126,16 @@ needs to be approved by an existing account. Setting up a Harvester ************************************************************************************** -Harvesters are set up using a part of the code of the main Galvanalyser repository. +Harvesters are set up using a part of the code of the main Galv repository. The first step, then, is to log onto the machine that will run the harvesters and clone the repository again. -If you are using the same server for the harvester and the rest of Galvanalyser, +If you are using the same server for the harvester and the rest of Galv, you can skip this step. .. code-block:: bash - git clone https://gitlab.com/battery-intelligence-lab/galvanalyser-project/galvanalyser.git - cd galvanalyser + git clone https://gitlab.com/battery-intelligence-lab/galv-project/galv.git + cd galv Next, launch the harvester container, specifying the Harvester's docker-compose configuration file: @@ -147,8 +147,8 @@ Next, launch the harvester container, specifying the Harvester's docker-compose This will launch into an interactive shell which will guide you through the Harvester setup process. -First, you'll be asked for the Galvanalyser server URL. -If you're running on the same server as the Galvanalyser server, this will be ``http://app``, +First, you'll be asked for the Galv server URL. +If you're running on the same server as the Galv server, this will be ``http://app``, otherwise it will be the path you entered above to connect to the web frontend, but using the ``api`` subdomain. So if you went to ``http://example.com``, go to ``http://api.example.com``. @@ -163,7 +163,7 @@ Select the regular user account. You can add other administrators and users to the Harvester using the web frontend later. When an administrator has been selected the Harvester will register itself with -the Galvanalyser server and begin to monitor for data files. +the Galv server and begin to monitor for data files. Of course, it currently has no directories to monitor, so the last step is to go to the web frontend and configure at least one monitored path for the Harvester. @@ -192,7 +192,7 @@ To start the server side system again after it has been stopped simply run ``docker-compose up`` in the root folder. A template SystemD service file is included in the repository root directory -``galvanalyser.service`` that can be used to automatically start the system on Linux servers. +``galv.service`` that can be used to automatically start the system on Linux servers. If Harvesters go down, they can be restarted. diff --git a/docs/source/UserGuide.rst b/docs/source/UserGuide.rst index 06bda596..926097e2 100644 --- a/docs/source/UserGuide.rst +++ b/docs/source/UserGuide.rst @@ -2,13 +2,13 @@ Galvalanyser User Guide ###################################################################################### -For help on setting up the Galvanalyser server and Harvesters, see the +For help on setting up the Galv server and Harvesters, see the :doc:`FirstTimeQuickSetup` guide. -Galvanalyser server +Galv server ================================================================================== -Once set up, the Galvanalyser server instance should not need attending to. +Once set up, the Galv server instance should not need attending to. To set it up, all you need to do is change the .env file's VIRTUAL_HOST_ROOT and LETSENCRYPT_EMAIL variables to your domain name and email. When you've verified that it works, you can also set LETSENCRYPT_TEST to false @@ -62,8 +62,8 @@ datasets are using them. REST API ------------------------------------------------------------------------------- -Endpoints are written as absolute paths starting from the Galvanalyser server -address, so to reach the ``/harvesters/`` endpoint for a Galvanalyser server +Endpoints are written as absolute paths starting from the Galv server +address, so to reach the ``/harvesters/`` endpoint for a Galv server located at ``http://api.localhost``, you would go to ``http://api.localhost/harvesters/``. API Spec @@ -217,7 +217,7 @@ This provides read-only access to datasets and their metadata, and allows you to write reproducible analysis scripts that do not require local storage to run their analyses. -You can download the latest Python API client :download:`here `. +You can download the latest Python API client :download:`here `. .. _harvesters: @@ -228,11 +228,11 @@ Harvesters are standalone programs that run continually in Docker containers. Each Harvester has a set of directories called :ref:`monitored-paths` that it watches for changes. When files appear in those paths, the Harvester reports the size to the -Galvanalyser server. +Galv server. If the file size has been stable for long enough, the Harvester will attempt -to import the dataset, sending its metadata and parsed data to the Galvanalyser server. +to import the dataset, sending its metadata and parsed data to the Galv server. -At the beginning of each cycle, the Harvester checks in with the Galvanalyser +At the beginning of each cycle, the Harvester checks in with the Galv server and updates its configuration if it has been changed. .. _monitored-paths: @@ -245,6 +245,14 @@ It is a good idea to use `Docker's volume mounting `_ +that is used to match files in the directory (the default is ``.*``). +The expression is applied to the filename after the Monitored path itself. +If your Monitored path is ``/data`` and your regular expression is ``^[a-z]+\.csv$``, +then the Harvester will match files like ``/data/abc.csv`` and ``/data/def.csv``. +The Monitored path regex can be used to group files with particular extensions, +with a particular format to their names, or to identify subdirectories +(although the subdirectories could be added as separate Monitored paths). .. _datasets: @@ -253,9 +261,9 @@ Datasets Files that are stable for long enough are parsed by the Harvester. If the file is suitable for parsing, its metadata will be sent to the -Galvanalyser server and a Dataset will be constructed to house the data. +Galv server and a Dataset will be constructed to house the data. -The file's data will then be extracted into Galvanalyser's column-value format +The file's data will then be extracted into Galv's column-value format and sent to the server. The column-value format means that column metadata is abstracted away, allowing every column to be stored as a series of numbers. diff --git a/docs/source/conf.py b/docs/source/conf.py index c183a807..d01df4ef 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -6,7 +6,7 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = 'Galvanalyser' +project = 'Galv' copyright = '2023, Oxford RSE' author = 'Oxford RSE' release = '2.0.0' diff --git a/docs/source/index.rst b/docs/source/index.rst index 6a39207f..8b721c0c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,11 +1,11 @@ -.. Galvanalyser documentation master file, created by +.. Galv documentation master file, created by sphinx-quickstart on Thu Mar 9 11:40:09 2023. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -.. image:: img/Galvanalyser-logo-lg.png +.. image:: img/Galv-logo-lg.png -Welcome to Galvanalyser's documentation! +Welcome to Galv's documentation! ====================================================================================== .. toctree:: diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 5a0e1d78..ec93fdc1 100644 --- a/frontend/Dockerfile +++ b/frontend/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 node:lts@sha256:132309f5136555725debd57b711eb4b329fff22a00588834dbec391a3f9782cf as build diff --git a/frontend/Dockerfile_dev b/frontend/Dockerfile_dev index df39b476..9a88bd1f 100644 --- a/frontend/Dockerfile_dev +++ b/frontend/Dockerfile_dev @@ -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 node:lts@sha256:132309f5136555725debd57b711eb4b329fff22a00588834dbec391a3f9782cf diff --git a/frontend/index.html b/frontend/index.html index 29b09c47..b9ced057 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,17 +2,17 @@ - + - Galvanalyser + Galv diff --git a/frontend/nginx.conf.template b/frontend/nginx.conf.template index 4572c66d..720f1930 100644 --- a/frontend/nginx.conf.template +++ b/frontend/nginx.conf.template @@ -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. error_log /var/log/nginx/error.log warn; diff --git a/frontend/public/index.html b/frontend/public/index.html index 811c4d5e..f3842055 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -2,17 +2,17 @@ - + - Galvanalyser + Galv diff --git a/frontend/src/APIConnection.ts b/frontend/src/APIConnection.ts index f80115c1..df8b4bfe 100644 --- a/frontend/src/APIConnection.ts +++ b/frontend/src/APIConnection.ts @@ -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 {API_ROOT} from "./conf.json" diff --git a/frontend/src/ActionButtons.tsx b/frontend/src/ActionButtons.tsx index f70080d5..353d11bc 100644 --- a/frontend/src/ActionButtons.tsx +++ b/frontend/src/ActionButtons.tsx @@ -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 React, {Component} from "react"; import Stack, {StackProps} from "@mui/material/Stack"; diff --git a/frontend/src/Api.js b/frontend/src/Api.js index d70c1641..270ff455 100644 --- a/frontend/src/Api.js +++ b/frontend/src/Api.js @@ -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. export const url = 'http://api.localhost/'; const headers = { diff --git a/frontend/src/App.css b/frontend/src/App.css index 43d35483..efa5c152 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -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. */ .App { diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index d5586759..77e234b1 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -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 React from "react"; import { @@ -42,7 +42,7 @@ import ChevronLeftIcon from '@mui/icons-material/ChevronLeft'; import ListItem from '@mui/material/ListItem'; import ListItemIcon from '@mui/material/ListItemIcon'; import ListItemText from '@mui/material/ListItemText'; -import { ReactComponent as GalvanalyserLogo } from './Galvanalyser-logo.svg'; +import { ReactComponent as GalvLogo } from './Galv-logo.svg'; import Connection, {APIMessage} from "./APIConnection"; import Stack from "@mui/material/Stack"; import Tokens from "./Tokens"; @@ -87,7 +87,7 @@ const useStyles = makeStyles()((theme) => { duration: theme.transitions.duration.enteringScreen, }), }, - galvanalyserLogo: { + galvLogo: { height: '40px' }, menuButton: { @@ -251,7 +251,7 @@ export default function Core() { > - + diff --git a/frontend/src/ApproveUsers.tsx b/frontend/src/ApproveUsers.tsx index 41b61af6..7157f56e 100644 --- a/frontend/src/ApproveUsers.tsx +++ b/frontend/src/ApproveUsers.tsx @@ -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 React, { Fragment } from 'react'; import Paper from '@mui/material/Paper'; @@ -14,7 +14,7 @@ import IconButton from "@mui/material/IconButton"; const columns = [ {label: 'Username'}, - {label: 'Approve', help: 'Authorize a user to access Galvanalyser'} + {label: 'Approve', help: 'Authorize a user to access Galv'} ] export default function ApproveUsers() { diff --git a/frontend/src/AsyncTable.tsx b/frontend/src/AsyncTable.tsx index eff49363..8e73af56 100644 --- a/frontend/src/AsyncTable.tsx +++ b/frontend/src/AsyncTable.tsx @@ -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 React, {Component, ReactElement, BaseSyntheticEvent, ReactEventHandler} from "react"; import TableContainer from "@mui/material/TableContainer"; diff --git a/frontend/src/CellList.tsx b/frontend/src/CellList.tsx index aab29b2e..cf1ebb09 100644 --- a/frontend/src/CellList.tsx +++ b/frontend/src/CellList.tsx @@ -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 React, {Fragment} from 'react'; import TextField from '@mui/material/TextField'; diff --git a/frontend/src/Cells.tsx b/frontend/src/Cells.tsx index 8c586047..1589ce79 100644 --- a/frontend/src/Cells.tsx +++ b/frontend/src/Cells.tsx @@ -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 React, {Fragment, useState} from 'react'; import TextField from '@mui/material/TextField'; diff --git a/frontend/src/DatasetChart.tsx b/frontend/src/DatasetChart.tsx index 388cbd8e..351f64ac 100644 --- a/frontend/src/DatasetChart.tsx +++ b/frontend/src/DatasetChart.tsx @@ -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 React, { useEffect, useState, Fragment } from "react"; import { ResponsiveLine, Datum } from '@nivo/line' @@ -48,7 +48,7 @@ type keyColumnMap = { [column_name in "time" | "volts" | "amps"]: ColumnFields | undefined; }; -// These values come from the fixtures injected into Galvanalyser's backend +// These values come from the fixtures injected into Galv's backend const TEST_TIME_COLUMN = "Time" const VOLTAGE_COLUMN = "Volts" const AMPS_COLUMN = "Amps" diff --git a/frontend/src/DatasetDetail.js b/frontend/src/DatasetDetail.js index 913b979b..0505019d 100644 --- a/frontend/src/DatasetDetail.js +++ b/frontend/src/DatasetDetail.js @@ -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 React, { useEffect, useState } from "react"; import Typography from '@mui/material/Typography'; diff --git a/frontend/src/Datasets.tsx b/frontend/src/Datasets.tsx index 1e766a7b..d981c4dc 100644 --- a/frontend/src/Datasets.tsx +++ b/frontend/src/Datasets.tsx @@ -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 React, {useState, Fragment, ReactElement, useEffect} from "react"; import Container from '@mui/material/Container'; diff --git a/frontend/src/Equipment.tsx b/frontend/src/Equipment.tsx index 862909db..9b767e78 100644 --- a/frontend/src/Equipment.tsx +++ b/frontend/src/Equipment.tsx @@ -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 React, { Fragment } from 'react'; import TextField from '@mui/material/TextField'; diff --git a/frontend/src/Files.tsx b/frontend/src/Files.tsx index f502ab15..fe183a79 100644 --- a/frontend/src/Files.tsx +++ b/frontend/src/Files.tsx @@ -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 React, { Fragment } from 'react'; import Container from '@mui/material/Container'; diff --git a/frontend/src/FormComponents.js b/frontend/src/FormComponents.js index af7389ce..572437c2 100644 --- a/frontend/src/FormComponents.js +++ b/frontend/src/FormComponents.js @@ -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 React from "react"; import TextField from '@mui/material/TextField'; diff --git a/frontend/src/Galvanalyser-icon.svg b/frontend/src/Galv-icon.svg similarity index 100% rename from frontend/src/Galvanalyser-icon.svg rename to frontend/src/Galv-icon.svg diff --git a/frontend/src/Galvanalyser-logo.svg b/frontend/src/Galv-logo.svg similarity index 100% rename from frontend/src/Galvanalyser-logo.svg rename to frontend/src/Galv-logo.svg diff --git a/frontend/src/GetDatasetMatlab.js b/frontend/src/GetDatasetMatlab.js index c10629d9..5e63991e 100644 --- a/frontend/src/GetDatasetMatlab.js +++ b/frontend/src/GetDatasetMatlab.js @@ -14,7 +14,7 @@ export default function GetDatasetMatlab({dataset}) { const host = Connection.url || `${window.location.protocol}//api.${domain}/`; const codeString = `%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% galvanalyser REST API access +% galv REST API access % - Matt Jaquiery (Oxford RSE) % % 2022-11-21 @@ -25,10 +25,10 @@ export default function GetDatasetMatlab({dataset}) { % % 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. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% login to galvanalyser > Generate API Token +% login to galv > Generate API Token token = '${token}'; apiURL = '${host}datasets'; options = weboptions('HeaderFields', {'Authorization' ['Bearer ' token]}); diff --git a/frontend/src/GetDatasetPython.js b/frontend/src/GetDatasetPython.js index 29f3245a..a45f39b8 100644 --- a/frontend/src/GetDatasetPython.js +++ b/frontend/src/GetDatasetPython.js @@ -34,7 +34,7 @@ export default function GetDatasetPython({dataset}) { { `# 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 batteryclient from batteryclient.api import users_api diff --git a/frontend/src/HarvesterDetail.tsx b/frontend/src/HarvesterDetail.tsx index 1fb46e95..e3ca6cf9 100644 --- a/frontend/src/HarvesterDetail.tsx +++ b/frontend/src/HarvesterDetail.tsx @@ -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 React, {useState, Fragment} from 'react'; import TextField from '@mui/material/TextField'; @@ -37,7 +37,12 @@ export default function HarvesterDetail(props: HarvesterDetailProps) { const [selected, setSelected] = useState(null) const addNewPath = (data: MonitoredPathFields) => { - const insert_data = {harvester: harvester.url, path: data.path, stable_time: data.stable_time} + const insert_data = { + harvester: harvester.url, + path: data.path, + regex: data.regex, + stable_time: data.stable_time + } return Connection.fetch('monitored_paths/', {body: JSON.stringify(insert_data), method: 'POST'}) }; const deletePath = (data: MonitoredPathFields) => Connection.fetch(data.url, {method: 'DELETE'}) @@ -133,7 +138,7 @@ export default function HarvesterDetail(props: HarvesterDetailProps) { ]} url={`monitored_paths/?harvester__id=${harvester.id}`} - new_row_values={{path: "", stable_time: 60}} + new_row_values={{path: "", regex: ".*", stable_time: 60}} styles={classes} /> {selected !== null && } diff --git a/frontend/src/HarvesterEnv.tsx b/frontend/src/HarvesterEnv.tsx index 791cb252..82e260de 100644 --- a/frontend/src/HarvesterEnv.tsx +++ b/frontend/src/HarvesterEnv.tsx @@ -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 React, {useState, BaseSyntheticEvent} from 'react'; import TextField from '@mui/material/TextField'; diff --git a/frontend/src/Harvesters.tsx b/frontend/src/Harvesters.tsx index 38a13bd6..d30804a3 100644 --- a/frontend/src/Harvesters.tsx +++ b/frontend/src/Harvesters.tsx @@ -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 React, {useState, Fragment, useRef} from 'react'; import TextField from '@mui/material/TextField'; diff --git a/frontend/src/Login.tsx b/frontend/src/Login.tsx index 1fe6c5c5..b9074cfe 100644 --- a/frontend/src/Login.tsx +++ b/frontend/src/Login.tsx @@ -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 { makeStyles } from 'tss-react/mui' import React, {useState, useRef, FormEvent, Fragment} from "react"; @@ -11,7 +11,7 @@ import TextField from '@mui/material/TextField'; import Typography from '@mui/material/Typography'; import Container from '@mui/material/Container'; import { useNavigate } from "react-router-dom"; -import { ReactComponent as GalvanalyserIcon} from './Galvanalyser-icon.svg'; +import { ReactComponent as GalvIcon} from './Galv-icon.svg'; import Connection, {User} from "./APIConnection"; import Grid from "@mui/material/Grid"; import Box from "@mui/material/Box"; @@ -125,7 +125,7 @@ export default function Login() { able to use the system. - To approve a user, log in to Galvanalyser as an active user and + To approve a user, log in to Galv as an active user and select the appropriate unapproved user from the 'users' tab on the left.