Skip to content

Commit

Permalink
Quickfix for global stats with model v2 (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito authored Jul 26, 2024
1 parent 9ed3150 commit 3dea2b3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .pyproject_generation/pyproject_custom.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "metldata"
version = "2.0.0"
version = "2.0.1"
description = "metldata - A framework for handling metadata based on ETL, CQRS, and event sourcing."
dependencies = [
"hexkit[akafka,mongodb] >=3, <4",
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ We recommend using the provided Docker container.

A pre-build version is available at [docker hub](https://hub.docker.com/repository/docker/ghga/metldata):
```bash
docker pull ghga/metldata:2.0.0
docker pull ghga/metldata:2.0.1
```

Or you can build the container yourself from the [`./Dockerfile`](./Dockerfile):
```bash
# Execute in the repo's root dir:
docker build -t ghga/metldata:2.0.0 .
docker build -t ghga/metldata:2.0.1 .
```

For production-ready deployment, we recommend using Kubernetes, however,
for simple use cases, you could execute the service using docker
on a single server:
```bash
# The entrypoint is preconfigured:
docker run -p 8080:8080 ghga/metldata:2.0.0 --help
docker run -p 8080:8080 ghga/metldata:2.0.1 --help
```

If you prefer not to use containers, you may install the service from source:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ classifiers = [
"Intended Audience :: Developers",
]
name = "metldata"
version = "2.0.0"
version = "2.0.1"
description = "metldata - A framework for handling metadata based on ETL, CQRS, and event sourcing."
dependencies = [
"hexkit[akafka,mongodb] >=3, <4",
Expand Down
13 changes: 9 additions & 4 deletions src/metldata/load/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,20 @@
STATS_COLLECTION_NAME = "stats"


# the following should be made configurable


def get_stat_slot(resource_class: str) -> str | None:
"""Get the name of the slot that shall be used as grouping key."""
if resource_class.endswith("File"):
return "format"
if resource_class.endswith("Protocol"):
if resource_class.endswith("Protocol"): # v1
return "type"
if resource_class.endswith("Individual"):
return "sex"
return None
return {
"Individual": "sex",
"Sample": "type",
"ExperimentMethod": "instrument_model", # v2
}.get(resource_class)


async def create_stats_using_aggregator(
Expand Down

0 comments on commit 3dea2b3

Please sign in to comment.