Skip to content

Commit

Permalink
Changing name to package folder
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed Dec 18, 2024
1 parent 3daf71b commit d16b209
Show file tree
Hide file tree
Showing 32 changed files with 75 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[run]
omit =
bam_data_store/_version.py
bam_masterdata/_version.py
*/__init__.py
8 changes: 4 additions & 4 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
uv pip install -e '.[dev]'
- name: mypy
run: |
python -m mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional --exclude dependencies bam_data_store tests
python -m mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional --exclude dependencies bam_masterdata tests
- name: Test with pytest
run: |
python -m pytest -sv --ignore=bam_data_store/dependencies tests
python -m pytest -sv --ignore=bam_masterdata/dependencies tests
build-and-install:
runs-on: ubuntu-latest
steps:
Expand All @@ -62,11 +62,11 @@ jobs:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
args: "check . --exclude bam_data_store/dependencies"
args: "check . --exclude bam_masterdata/dependencies"
ruff-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
args: "format . --check --verbose --exclude bam_data_store/dependencies"
args: "format . --check --verbose --exclude bam_masterdata/dependencies"
2 changes: 1 addition & 1 deletion .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uv pip install coveralls
- name: Build coverage file
run: |
pytest --cov-config=.coveragerc --junitxml=pytest.xml --cov=bam_data_store tests | tee pytest-coverage.txt
pytest --cov-config=.coveragerc --junitxml=pytest.xml --cov=bam_masterdata tests | tee pytest-coverage.txt
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ cython_debug/
# Ruff
.ruff_cache

# static artifacts
artifacts

# pytest coverage
pytest.xml
pytest-coverage.txt
pytest-coverage.txt

# artifacts
artifacts
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "bam_data_store/dependencies/openbisschema"]
path = bam_data_store/dependencies/openbisschema
[submodule "bam_masterdata/dependencies/openbisschema"]
path = bam_masterdata/dependencies/openbisschema
url = https://git.bam.de/bam-data-store/development/openbisschema.git
8 changes: 4 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"type": "debugpy",
"request": "launch",
"console": "integratedTerminal",
"program": "${workspaceFolder}/src/bam_data_store/app.py", // path to your entry point Python module
"program": "${workspaceFolder}/src/bam_masterdata/app.py", // path to your entry point Python module
},
{
"name": "bds tests",
Expand All @@ -51,11 +51,11 @@
]
},
{
"name": "bds export-entities-to-json",
"name": "bds export-to-json",
"type": "debugpy",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/.venv/bin/bam_data_store",
"program": "${workspaceFolder}/.venv/bin/bam_masterdata",
"justMyCode": false,
"args": ["export-entities-to-json"]
},
Expand All @@ -64,7 +64,7 @@
"type": "debugpy",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/.venv/bin/bam_data_store",
"program": "${workspaceFolder}/.venv/bin/bam_masterdata",
"justMyCode": false,
"args": ["export-entities-to-excel"]
},
Expand Down
39 changes: 24 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# BAMDataStore

This is the main repository of the BAM Data Store project. This is both a Python package and a web connecting the different resources for the Data Store.
# BAM Masterdata

The BAM Masterdata is a repository containing all the masterdata schema defining in BAM, as well as some utility functions to handle the masterdata.

<!--
## Getting started
Expand All @@ -11,45 +10,51 @@ This is the main repository of the BAM Data Store project. This is both a Python
## Development

If you want to develop locally this package, clone the project and enter in the workspace folder:

```sh
git clone https://git.bam.de/bam-data-store/bam-data-store.git
cd bam-data-store
git clone https://git.bam.de/bam-data-store/bam-masterdata.git
cd bam-masterdata
```

Create a virtual environment (you can use Python>3.9) in your workspace:

```sh
python3 -m venv .venv
source .venv/bin/activate
```

Run the following script:

```sh
./scripts/install_python_dependencies
```


### Run the tests

You can locally run the tests by doing:

```sh
python -m pytest -sv tests
```

where the `-s` and `-v` options toggle the output verbosity.

You can also generate a local coverage report:

```sh
python -m pytest --cov=src tests
```

### Run auto-formatting and linting

We use [Ruff](https://docs.astral.sh/ruff/) for formatting and linting the code following the rules specified in the `pyproject.toml`. You can run locally:

```sh
ruff check .
```

This will produce an output with the specific issues found. In order to auto-fix them, run:

```sh
ruff format . --check
```
Expand Down Expand Up @@ -93,21 +98,25 @@ The settings configuration file `.vscode/settings.json` automatically applies th
### Documentation on Github pages

To view the documentation locally, make sure to have installed the extra packages (this is part of the `scripts/install_python_dependencies.sh`, so if you ran this script before, you don't need to do it again now):

```sh
uv pip install -e '[docu]'
```

The first time, build the server:

```sh
mkdocs build
```

Run the documentation server:

```sh
mkdocs serve
```

The output looks like:

```sh
INFO - Building documentation...
INFO - Cleaning site directory
Expand All @@ -119,12 +128,12 @@ Simply click on `http://127.0.0.1:8000/`. The changes in the `md` files of the d

## Main contributors

| Name | E-mail | Role |
|------|------------|--------|
| Dr. Angela Ariza | [[email protected]](mailto:[email protected]) | Outreach and Training |
| Caroline Demidova | [[email protected]](mailto:[email protected]) | Outreach and Training |
| Daniel Kosztyla | [[email protected]](mailto:[email protected]) | IT |
| Carlos Madariaga | [[email protected]](mailto:[email protected]) | Software Developer |
| Kristina Meindl | [[email protected]](mailto:[email protected]) | Project Manager |
| Dr. Jose M. Pizarro | [[email protected]](mailto:[email protected]) | Data Management |
| Jörg Rädler | [[email protected]](mailto:[email protected]) | IT |
| Name | E-mail | Role |
| ------------------- | ------------------------------------------------------------ | --------------------- |
| Dr. Angela Ariza | [[email protected]](mailto:[email protected]) | Outreach and Training |
| Caroline Demidova | [[email protected]](mailto:[email protected]) | Outreach and Training |
| Daniel Kosztyla | [[email protected]](mailto:[email protected]) | IT |
| Carlos Madariaga | [[email protected]](mailto:[email protected]) | Software Developer |
| Kristina Meindl | [[email protected]](mailto:[email protected]) | Project Manager |
| Dr. Jose M. Pizarro | [[email protected]](mailto:[email protected]) | Data Management |
| Jörg Rädler | [[email protected]](mailto:[email protected]) | IT |
1 change: 0 additions & 1 deletion bam_data_store/dependencies/openbisschema
Submodule openbisschema deleted from f27dda
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions bam_data_store/cli/cli.py → bam_masterdata/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
import click
from openpyxl import Workbook

from bam_data_store.cli.entities_to_excel import entities_to_excel
from bam_data_store.cli.entities_to_json import entities_to_json
from bam_data_store.logger import logger
from bam_data_store.utils import (
from bam_masterdata.cli.entities_to_excel import entities_to_excel
from bam_masterdata.cli.entities_to_json import entities_to_json
from bam_masterdata.logger import logger
from bam_masterdata.utils import (
delete_and_create_dir,
import_module,
listdir_py_modules,
)


@click.group(help='Entry point to run `bam_data_store` CLI commands.')
@click.group(help='Entry point to run `bam_masterdata` CLI commands.')
def cli():
pass


@cli.command(help='Export entities to JSON files to the `./artifacts/` folder.')
def export_entities_to_json():
# Get the directories from the Python modules and the export directory for the static artifacts
datamodel_dir = os.path.join('.', 'bam_data_store', 'datamodel')
datamodel_dir = os.path.join('.', 'bam_masterdata', 'datamodel')
export_dir = os.path.join('.', 'artifacts')

# Delete and create the export directory
Expand All @@ -44,12 +44,12 @@ def export_entities_to_json():
)
def export_entities_to_excel():
# Get the Python modules to process the datamodel
datamodel_dir = os.path.join('.', 'bam_data_store', 'datamodel')
datamodel_dir = os.path.join('.', 'bam_masterdata', 'datamodel')
py_modules = listdir_py_modules(directory_path=datamodel_dir, logger=logger)

# Load the definitions module classes
definitions_module = import_module(
module_path='./bam_data_store/metadata/definitions.py'
module_path='./bam_masterdata/metadata/definitions.py'
)

# Process the modules and save the entities to the openBIS masterdata Excel file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
if TYPE_CHECKING:
from openpyxl.worksheet.worksheet import Worksheet

from bam_data_store.utils import import_module
from bam_masterdata.utils import import_module


def entities_to_excel(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import click

from bam_data_store.utils import delete_and_create_dir, import_module
from bam_masterdata.utils import delete_and_create_dir, import_module


def entities_to_json(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from bam_data_store.metadata.definitions import (
from bam_masterdata.metadata.definitions import (
CollectionTypeDef,
PropertyTypeAssignment,
)
from bam_data_store.metadata.entities import CollectionType
from bam_masterdata.metadata.entities import CollectionType


class DefaultExperiment(CollectionType):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from bam_data_store.metadata.definitions import ObjectTypeDef, PropertyTypeAssignment
from bam_data_store.metadata.entities import ObjectType
from bam_masterdata.metadata.definitions import ObjectTypeDef, PropertyTypeAssignment
from bam_masterdata.metadata.entities import ObjectType


class Instrument(ObjectType):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from bam_data_store.metadata.definitions import PropertyTypeDef
from bam_masterdata.metadata.definitions import PropertyTypeDef

Name = PropertyTypeDef(
version=1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from bam_data_store.metadata.definitions import (
from bam_masterdata.metadata.definitions import (
VocabularyTerm,
VocabularyTypeDef,
)
from bam_data_store.metadata.entities import VocabularyType
from bam_masterdata.metadata.entities import VocabularyType


class DocumentType(VocabularyType):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from pydantic import BaseModel, ConfigDict, Field, model_validator

from bam_data_store.metadata.definitions import (
from bam_masterdata.metadata.definitions import (
CollectionTypeDef,
ObjectTypeDef,
PropertyTypeAssignment,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import importlib.util
import os
import shutil
import sys
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
Expand Down
6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
site_name: BAM Data Store Wiki
site_description: Documentation page for the BAM Data Store.
site_name: BAM Masterdata
site_description: Documentation page for the BAM Masterdata.
site_author: BAM Data Store
repo_url: https://github.com/BAMresearch/bam-data-store
repo_url: https://github.com/BAMresearch/bam-masterdata
nav:
- Home: index.md
- Tutorial:
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
name = "bam-data-store"
name = "bam-masterdata"
description = "The BAM Data Store utility tools and masterdata models wrapped in a Python package with a front-end web interface."
dynamic = ["version"]
readme = "README.md"
Expand All @@ -33,8 +33,8 @@ dependencies = [
]

[project.urls]
"Homepage" = "https://git.bam.de/bam-data-store/bam-data-store"
"Bug Tracker" = "https://git.bam.de/bam-data-store/development/bam-data-store/issues"
"Homepage" = "https://github.com/BAMresearch/bam-masterdata"
"Bug Tracker" = "https://github.com/BAMresearch/bam-masterdata/issues"

[project.optional-dependencies]
dev = [
Expand All @@ -59,11 +59,11 @@ docu = [
]

[project.scripts]
bam_data_store = "bam_data_store.cli:cli"
bam_masterdata = "bam_masterdata.cli:cli"

[tool.ruff]
# Exclude a variety of commonly ignored directories.
include = ["bam_data_store/*.py", "tests/*.py"]
include = ["bam_masterdata/*.py", "tests/*.py"]
exclude = [
".bzr",
".direnv",
Expand Down Expand Up @@ -143,4 +143,4 @@ exclude = ["dependencies*"]
namespaces = false

[tool.setuptools_scm]
write_to = "bam_data_store/_version.py"
write_to = "bam_masterdata/_version.py"
2 changes: 1 addition & 1 deletion scripts/install_python_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ echo "Installing main project dependencies..."
uv pip install -e '.[dev,docu,jupy]'

echo "Installing submodule dependencies..."
SUBMODULE_PATH="bam_data_store/dependencies/openbisschema"
SUBMODULE_PATH="bam_masterdata/dependencies/openbisschema"

if [ -d "$SUBMODULE_PATH" ]; then
pushd "$SUBMODULE_PATH" > /dev/null
Expand Down
Loading

1 comment on commit d16b209

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
bam_masterdata
   logger.py80100% 
bam_masterdata/cli
   cli.py363636 0%
   entities_to_excel.py404040 0%
   entities_to_json.py353535 0%
bam_masterdata/datamodel
   collection_types.py777 0%
   dataset_types.py00100% 
   object_types.py111111 0%
   property_types.py222 0%
   vocabulary_types.py141414 0%
bam_masterdata/metadata
   definitions.py7844 95%
   entities.py4533 93%
bam_masterdata/utils
   utils.py331111 67%
TOTAL30916347% 

Tests Skipped Failures Errors Time
50 1 💤 0 ❌ 0 🔥 0.279s ⏱️

Please sign in to comment.