Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Rename to galv (#105)
Browse files Browse the repository at this point in the history
* rename galvanalyser -> galv

* fix regex for newly created monitored paths

* documentation for monitored path regex
  • Loading branch information
mjaquiery authored Jun 28, 2023
1 parent aaf43a5 commit c32aa75
Show file tree
Hide file tree
Showing 132 changed files with 301 additions and 286 deletions.
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -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: ''
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/side-effects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -41,16 +41,16 @@ 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
id: cache-save
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
Expand All @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/

Expand Down
2 changes: 1 addition & 1 deletion .worker.env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<img src="docs/source/img/Galvanalyser-logo-sm.png" width="500" />
<img src="docs/source/img/Galv-logo-sm.png" width="500" />

[![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)
<a href="https://Battery-Intelligence-Lab.github.io/galvanalyser/" target="_blank">
[![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)
<a href="https://Battery-Intelligence-Lab.github.io/galv/" target="_blank">
[![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)
</a>

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:

Expand All @@ -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.

<p align="center">
<img src="docs/source/img/GalvanalyserStructure.PNG" alt="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." width="600" />
<img src="docs/source/img/GalvStructure.PNG" alt="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." width="600" />
</p>


## 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`.
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion backend/Dockerfile-test
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions backend/backend_django/config/__init__.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion backend/backend_django/config/asgi.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion backend/backend_django/config/settings.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
10 changes: 5 additions & 5 deletions backend/backend_django/config/settings_dev.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -54,7 +54,7 @@
'rest_framework',
'django_filters',
'knox',
'galvanalyser.apps.GalvanalyserConfig',
'galv.apps.GalvConfig',
'drf_spectacular'
]

Expand Down Expand Up @@ -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"}
}
}

Expand Down Expand Up @@ -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',
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions backend/backend_django/config/settings_prod.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -62,7 +62,7 @@
'rest_framework',
'django_filters',
'knox',
'galvanalyser.apps.GalvanalyserConfig',
'galv.apps.GalvConfig',
'drf_spectacular',
]

Expand Down Expand Up @@ -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"}
}
}

Expand Down Expand Up @@ -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',
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions backend/backend_django/config/urls.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion backend/backend_django/config/wsgi.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Loading

0 comments on commit c32aa75

Please sign in to comment.