Skip to content

Commit

Permalink
Merge branch 'master' into flb/review_checklist
Browse files Browse the repository at this point in the history
  • Loading branch information
francescalb authored Mar 24, 2022
2 parents 7f997d3 + 1ffc003 commit 2713190
Show file tree
Hide file tree
Showing 24 changed files with 263 additions and 150 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cd_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.9

Expand All @@ -47,9 +47,9 @@ jobs:
- name: Update version and tag
run: |
invoke setver --ver="${GITHUB_REF#refs/tags/}"
invoke setver --version="${GITHUB_REF#refs/tags/}"
git add oteapi/__init__.py CHANGELOG.md
git add oteapi_dlite/__init__.py CHANGELOG.md
git commit -m "Release ${GITHUB_REF#refs/tags/} - Changelog"
TAG_MSG=.github/utils/release_tag_msg.txt
Expand Down Expand Up @@ -101,13 +101,13 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.PUBLISH_UPDATE_BRANCH }}

- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.9

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_automerge_dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci_cd_updated_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ env.DEPENDABOT_BRANCH }}
fetch-depth: 0
Expand Down Expand Up @@ -78,13 +78,13 @@ jobs:

- name: Checkout repository
if: env.RELEASE_RUN == 'false'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python 3.9
if: env.RELEASE_RUN == 'false'
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.9

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci_dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master

- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.9

Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:

- name: Create PR
id: cpr
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.RELEASE_PAT }}
commit-message: New @dependabot-fueled updates
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
# timeout-minutes: 2

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.9

Expand Down Expand Up @@ -47,12 +47,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.9

Expand Down Expand Up @@ -85,12 +85,12 @@ jobs:
python-version: ["3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Set up Python ${{ matrix.python-version}}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version}}

Expand Down Expand Up @@ -120,12 +120,12 @@ jobs:
python-version: ["3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Set up Python ${{ matrix.python-version}}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version}}

Expand All @@ -151,9 +151,9 @@ jobs:
# timeout-minutes: 5

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v3
with:
python-version: 3.9

Expand All @@ -170,11 +170,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: actions/setup-python@v2
- uses: actions/setup-python@v3
with:
python-version: 3.9

Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ repos:
args: ["--profile", "black", "--filter-files", "--skip-gitignore"]

- repo: https://github.com/ambv/black
rev: 21.12b0
rev: 22.1.0
hooks:
- id: black

- repo: https://github.com/PyCQA/bandit
rev: 1.7.2
rev: 1.7.4
hooks:
- id: bandit
args: ["-r"]
files: ^oteapi_dlite/.*$

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.931
rev: v0.941
hooks:
- id: mypy
exclude: ^tests/.*$
Expand Down
84 changes: 83 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,85 @@
# Changelog

This file will hold an auto-generated changelog for you project.
## [Unreleased](https://github.com/EMMC-ASBL/oteapi-dlite/tree/HEAD)

[Full Changelog](https://github.com/EMMC-ASBL/oteapi-dlite/compare/v0.0.7...HEAD)

**Fixed bugs:**

- Tests are failing when using the `oteapi-core`@master [\#32](https://github.com/EMMC-ASBL/oteapi-dlite/issues/32)
- Fix Excel parser [\#8](https://github.com/EMMC-ASBL/oteapi-dlite/issues/8)

## [v0.0.7](https://github.com/EMMC-ASBL/oteapi-dlite/tree/v0.0.7) (2022-03-17)

[Full Changelog](https://github.com/EMMC-ASBL/oteapi-dlite/compare/v0.0.6...v0.0.7)

**Merged pull requests:**

- Fix tests + excel parser [\#33](https://github.com/EMMC-ASBL/oteapi-dlite/pull/33) ([CasperWA](https://github.com/CasperWA))

## [v0.0.6](https://github.com/EMMC-ASBL/oteapi-dlite/tree/v0.0.6) (2022-03-16)

[Full Changelog](https://github.com/EMMC-ASBL/oteapi-dlite/compare/v0.0.5...v0.0.6)

**Fixed bugs:**

- Documentation issue [\#25](https://github.com/EMMC-ASBL/oteapi-dlite/issues/25)

**Merged pull requests:**

- Fix setup.cfg [\#31](https://github.com/EMMC-ASBL/oteapi-dlite/pull/31) ([jesper-friis](https://github.com/jesper-friis))
- \[Auto-generated\] Update dependencies [\#30](https://github.com/EMMC-ASBL/oteapi-dlite/pull/30) ([TEAM4-0](https://github.com/TEAM4-0))
- Corrected syntax in setup.cfg [\#28](https://github.com/EMMC-ASBL/oteapi-dlite/pull/28) ([jesper-friis](https://github.com/jesper-friis))

## [v0.0.5](https://github.com/EMMC-ASBL/oteapi-dlite/tree/v0.0.5) (2022-03-11)

[Full Changelog](https://github.com/EMMC-ASBL/oteapi-dlite/compare/v0.0.4...v0.0.5)

**Merged pull requests:**

- Updated strategy names [\#27](https://github.com/EMMC-ASBL/oteapi-dlite/pull/27) ([jesper-friis](https://github.com/jesper-friis))
- \[Auto-generated\] Update dependencies [\#26](https://github.com/EMMC-ASBL/oteapi-dlite/pull/26) ([TEAM4-0](https://github.com/TEAM4-0))
- Updated dlite image parse strategy according to changes in the image parse strategy in oteapi core PR \#108 [\#18](https://github.com/EMMC-ASBL/oteapi-dlite/pull/18) ([jesper-friis](https://github.com/jesper-friis))

## [v0.0.4](https://github.com/EMMC-ASBL/oteapi-dlite/tree/v0.0.4) (2022-03-07)

[Full Changelog](https://github.com/EMMC-ASBL/oteapi-dlite/compare/v0.0.3...v0.0.4)

**Fixed bugs:**

- Release workflow failing [\#22](https://github.com/EMMC-ASBL/oteapi-dlite/issues/22)

**Merged pull requests:**

- Fix folder reference in workflow [\#24](https://github.com/EMMC-ASBL/oteapi-dlite/pull/24) ([CasperWA](https://github.com/CasperWA))
- Fix option name for `invoke setver` [\#23](https://github.com/EMMC-ASBL/oteapi-dlite/pull/23) ([CasperWA](https://github.com/CasperWA))

## [v0.0.3](https://github.com/EMMC-ASBL/oteapi-dlite/tree/v0.0.3) (2022-03-05)

[Full Changelog](https://github.com/EMMC-ASBL/oteapi-dlite/compare/v0.0.2...v0.0.3)

**Merged pull requests:**

- Add serialise filter [\#17](https://github.com/EMMC-ASBL/oteapi-dlite/pull/17) ([jesper-friis](https://github.com/jesper-friis))
- Added a simple filter that adds a collection to the session [\#15](https://github.com/EMMC-ASBL/oteapi-dlite/pull/15) ([jesper-friis](https://github.com/jesper-friis))

## [v0.0.2](https://github.com/EMMC-ASBL/oteapi-dlite/tree/v0.0.2) (2022-03-05)

[Full Changelog](https://github.com/EMMC-ASBL/oteapi-dlite/compare/04843680b62d6bb3bc16e5ff644edbcc40892f31...v0.0.2)

**Closed issues:**

- Add CI/CD workflow\(s\) [\#3](https://github.com/EMMC-ASBL/oteapi-dlite/issues/3)

**Merged pull requests:**

- Relaxed dependencies [\#16](https://github.com/EMMC-ASBL/oteapi-dlite/pull/16) ([jesper-friis](https://github.com/jesper-friis))
- fix ci cd workflow [\#14](https://github.com/EMMC-ASBL/oteapi-dlite/pull/14) ([jesper-friis](https://github.com/jesper-friis))
- Add MANIFEST.in [\#9](https://github.com/EMMC-ASBL/oteapi-dlite/pull/9) ([CasperWA](https://github.com/CasperWA))
- Image parser [\#7](https://github.com/EMMC-ASBL/oteapi-dlite/pull/7) ([TorgeirUstad](https://github.com/TorgeirUstad))
- Add CI/CD [\#4](https://github.com/EMMC-ASBL/oteapi-dlite/pull/4) ([jesper-friis](https://github.com/jesper-friis))
- Parse excel [\#1](https://github.com/EMMC-ASBL/oteapi-dlite/pull/1) ([jesper-friis](https://github.com/jesper-friis))



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ OTEAPI DLite Plugin has been created via the [cookiecutter](https://cookiecutter

OTEAPI DLite Plugin has been supported by the following projects:

- **OntoTrans** (2020-2024) that receives funding from the European Union’s Horizon 2020 Research and Innovation Programme, under Grant Agreement n. 862136.
* __OntoTrans__ (2020-2024) that receives funding from the European Union’s Horizon 2020 Research and Innovation Programme, under Grant Agreement no. 862136.

* __VIPCOAT__ (2021-2025) receives funding from the European Union’s Horizon 2020 Research and Innovation Programme - DT-NMBP-11-2020 Open Innovation Platform for Materials Modelling, under Grant Agreement no: 952903.

* __OpenModel__ (2021-2025) receives funding from the European Union’s Horizon 2020 Research and Innovation Programme - DT-NMBP-11-2020 Open Innovation Platform for Materials Modelling, under Grant Agreement no: 953167.
6 changes: 5 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ OTEAPI DLite Plugin has been created via the [cookiecutter](https://cookiecutter

OTEAPI DLite Plugin has been supported by the following projects:

- **OntoTrans** (2020-2024) that receives funding from the European Union’s Horizon 2020 Research and Innovation Programme, under Grant Agreement n. 862136.
* __OntoTrans__ (2020-2024) that receives funding from the European Union’s Horizon 2020 Research and Innovation Programme, under Grant Agreement no. 862136.

* __VIPCOAT__ (2021-2025) receives funding from the European Union’s Horizon 2020 Research and Innovation Programme - DT-NMBP-11-2020 Open Innovation Platform for Materials Modelling, under Grant Agreement no: 952903.

* __OpenModel__ (2021-2025) receives funding from the European Union’s Horizon 2020 Research and Innovation Programme - DT-NMBP-11-2020 Open Innovation Platform for Materials Modelling, under Grant Agreement no: 953167.
2 changes: 1 addition & 1 deletion oteapi_dlite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
Created from cookiecutter-oteapi-plugin, SINTEF, 2022
"""

__version__ = "0.0.3"
__version__ = "0.0.7"
__author__ = "team4.0@sintef.no"
__author_email__ = "team4.0@sintef.no"
23 changes: 15 additions & 8 deletions oteapi_dlite/strategies/filter.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""Trivial filter that adds an empty collection to the session."""
# pylint: disable=no-self-use,unused-argument
from dataclasses import dataclass
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Any, Dict

import dlite
from oteapi.models import FilterConfig
from pydantic import Field
from pydantic.dataclasses import dataclass

from oteapi_dlite.models import DLiteSessionUpdate

if TYPE_CHECKING:
from typing import Any, Dict, Optional

from oteapi.models import FilterConfig
from typing import Optional


@dataclass
Expand All @@ -19,11 +19,18 @@ class CreateCollectionStrategy:
**Registers strategies**:
- `("filterType", "create_collection")`
- `("filterType", "dlite/create-collection")`
"""

filter_config: "FilterConfig"
filter_config: FilterConfig

# Find a better way to keep collections alive!!!
# Need to be `Any`, because otherwise `pydantic` complains.
collection_refs: Dict[str, Any] = Field(
{},
description="A dictionary of DLite Collections.",
)

def initialize(
self, session: "Optional[Dict[str, Any]]" = None
Expand All @@ -37,7 +44,7 @@ def initialize(

# Save reference to the collection to ensure that it lives as long as
# the session does
session["_collection_ref"] = coll
self.collection_refs[coll.uuid] = coll

return DLiteSessionUpdate(collection_id=coll.uuid)

Expand Down
Loading

0 comments on commit 2713190

Please sign in to comment.