Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new symmetry fields to structure model #1422

Draft
wants to merge 75 commits into
base: 0.25.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
cf45488
Update requirements-client.txt (#1813)
JPBergsma Oct 13, 2023
8510ffa
Modernize all Python 3.8 annotations (#1815)
ml-evs Oct 15, 2023
a943532
First attempts at migrating to pydantic v2
ml-evs Aug 11, 2023
e099e8e
Fix optional dependency group naming
CasperWA Oct 11, 2023
e9fff07
Fix all validators and StrictField
CasperWA Oct 11, 2023
a53dfc8
Major breakthrough - fixing ServerConfig
CasperWA Oct 11, 2023
6ac5209
Update codebase according to mypy
CasperWA Oct 12, 2023
e809cbe
Update ways to work with JSON schema
CasperWA Oct 12, 2023
55fc6b3
Down to 4 failing tests for the same thing
CasperWA Oct 13, 2023
a9bd67a
Update dependencies
CasperWA Oct 13, 2023
4719b3c
Fix docs building
CasperWA Oct 13, 2023
ad2e5a2
Fixed the final issue(s)
CasperWA Oct 14, 2023
295dac1
Use Py3.9-compliant typing
CasperWA Oct 14, 2023
a8be16f
Try to fix up everything to support pydantic v2
CasperWA Oct 14, 2023
550899c
Remove `nullable` field from properties
CasperWA Oct 14, 2023
f852e1f
Use typing.Annotated throughout, where possible
CasperWA Oct 15, 2023
4abf3f3
Satisfy mypy all around
CasperWA Oct 15, 2023
f2ad2ac
Use ClassVar instead of PrivateAttr
CasperWA Oct 15, 2023
379110c
Final fixup
ml-evs Oct 15, 2023
77de621
Update dependencies (#1834)
bot-optimade Oct 23, 2023
39a423e
Comment: Fixed an inappropriate test expression to remove a logical s…
munahaf Oct 25, 2023
861ff08
Update dependencies (#1846)
bot-optimade Nov 1, 2023
7735295
More robust provider fetching in client
ml-evs Nov 5, 2023
2970d9a
Add click version option for client
ml-evs Nov 5, 2023
55e2dd0
Add a test that checks whether at least one database can be found in …
ml-evs Nov 5, 2023
0a34a49
Fix incorrect 'smart' union discrimination (#1844)
ml-evs Nov 5, 2023
a13cd61
Update dependencies (#1857)
bot-optimade Nov 6, 2023
cf8c3f3
Tweak README version compatibility table to give actual pip reqs
ml-evs Nov 6, 2023
5b0a3cc
Add Python 3.12 to CI (#1858)
ml-evs Nov 7, 2023
590bdac
CI performance refresh (#1836)
ml-evs Nov 7, 2023
bcbe36d
Try Python 3.9 in fly build to reduce memory usage (#1860)
ml-evs Nov 7, 2023
71267ff
Disable adding test data in demo server (#1861)
ml-evs Nov 7, 2023
bbb64d6
Revert test data insertion and instead increase fly swap (#1862)
ml-evs Nov 7, 2023
e25fd6e
Explicitly set builder for Fly (#1863)
ml-evs Nov 7, 2023
3bc7025
Debugging fly configuration (#1864)
ml-evs Nov 7, 2023
2da87b3
Manually generate Fly environment (#1865)
ml-evs Nov 7, 2023
ade6a42
Try to resolve new fly builder deps (#1866)
ml-evs Nov 7, 2023
56f006e
Update config file location for Fly deployment (#1867)
ml-evs Nov 7, 2023
061093b
Try to force fly to use the config file (#1870)
ml-evs Nov 7, 2023
6b6bda7
Try to force fly to use the config file in Procfile (#1871)
ml-evs Nov 7, 2023
eaa4315
Release v1.0.0 - Changelog
bot-optimade Nov 9, 2023
c34410c
Add optional test for whether entry endpoints have any actual entries…
ml-evs Dec 4, 2023
6a2b306
Update dependencies (#1887)
bot-optimade Dec 4, 2023
73fca92
Release v1.0.1 - Changelog
bot-optimade Dec 4, 2023
246b8d0
Switch entirely to ruff and remove all other linters (#1907)
ml-evs Dec 18, 2023
7e6092b
Update dependencies (#1908)
bot-optimade Dec 19, 2023
b7c9dda
Bump providers from `564a499` to `d8322a4` (#1909)
dependabot[bot] Dec 27, 2023
ed27075
Update dependencies (#1921)
bot-optimade Jan 1, 2024
65bb1cb
Client: add ability to count the number of results using binary searc…
ml-evs Jan 10, 2024
f17897f
Bump providers from `d8322a4` to `93d2b52` (#1926)
dependabot[bot] Jan 11, 2024
c3ed532
Add upper pin to numpy in preparation for numpy v2 (#1928)
ml-evs Jan 11, 2024
9452121
Release v1.0.2 - Changelog
bot-optimade Jan 11, 2024
404a48f
Allow backported releases in CI (#1933)
ml-evs Jan 11, 2024
6f76250
mkdocs fix global setting of `members: true` (#1936)
ml-evs Jan 12, 2024
b646a0a
Client: attempt to switch to synchronous mode when existing event loo…
ml-evs Jan 17, 2024
0013b2a
Add upper pin for pandas and ignore warning (#1945)
ml-evs Jan 22, 2024
9e87362
Bump providers from `93d2b52` to `97c69be` (#1941)
dependabot[bot] Jan 22, 2024
2405c46
Bump providers from `97c69be` to `46c8d85` (#1946)
dependabot[bot] Jan 23, 2024
5b03652
Bump providers from `46c8d85` to `ad0e214` (#1948)
dependabot[bot] Jan 29, 2024
18be085
Update dependencies (#1953)
bot-optimade Jan 30, 2024
fe4995d
Add `requests` timeout when getting providers list (#1955)
ml-evs Jan 30, 2024
a29b95b
Fix release workflow (#1959)
ml-evs Jan 30, 2024
9b4ae9f
Release v1.0.3 - Changelog
bot-optimade Jan 30, 2024
66aeb2b
Update dependencies (#1962)
bot-optimade Feb 2, 2024
7bd41d8
Bump fastapi from 0.109.0 to 0.109.1 (#1969)
dependabot[bot] Feb 5, 2024
89f8860
Update dependencies (#1980)
bot-optimade Feb 20, 2024
e8eff68
Update dependencies (#1990)
bot-optimade Mar 21, 2024
a1a71b9
Use simple bools in pymatgen Structure converter (#2021)
ml-evs Mar 29, 2024
93ae8a0
Release v1.0.4 - Changelog
bot-optimade Mar 29, 2024
9da9e2c
Update dependencies (#2022)
bot-optimade Apr 1, 2024
33bb647
Update dependencies (#2048)
bot-optimade May 13, 2024
8796751
Update dependencies (#2068)
bot-optimade Jun 9, 2024
5d50f2f
Add `skip_ssl` flag/option to client (#2086)
ml-evs Jun 11, 2024
5d47531
Release v1.0.5 - Changelog
bot-optimade Jun 11, 2024
2033b86
Add symmetry fields to structure model
ml-evs Dec 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/fly.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# fly.toml file generated for broken-field-1976 on 2022-11-21T21:37:55Z

app = "optimade"
kill_signal = "SIGINT"
kill_timeout = 5
swap_size_mb = 1024
processes = []

[build]
builder = "paketobuildpacks/builder:base"

[env]
PORT = 5000
BPE_OPTIMADE_CONFIG_FILE = "./tests/test_config.json"
BPL_OPTIMADE_CONFIG_FILE = "./tests/test_config.json"
OPTIMADE_CONFIG_FILE = "./tests/test_config.json"

[experimental]
allowed_public_ports = []
Expand Down Expand Up @@ -36,9 +42,3 @@ processes = []
interval = "15s"
restart_limit = 0
timeout = "2s"

[build]
builtin = "python"

[build.settings]
pythonbase = "3.10-slim-buster"
52 changes: 40 additions & 12 deletions .github/workflows/cd_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,44 @@ on:
- published

env:
PUBLISH_UPDATE_BRANCH: master
GIT_USER_NAME: OPTIMADE Developers
GIT_USER_EMAIL: "dev@optimade.org"
DEFAULT_RELEASE_BRANCH: "master"

jobs:

publish:
name: Publish OPTIMADE Python tools
runs-on: ubuntu-latest
if: github.repository == 'Materials-Consortia/optimade-python-tools' && startsWith(github.ref, 'refs/tags/v')
outputs:
publish_branch: ${{ steps.save_branch.outputs.publish_branch }}

steps:
- name: Checkout repository
- name: Get triggering branch
uses: octokit/request-action@v2.x
id: get_release_branch
with:
route: GET /repos/{owner}/{repo}/releases/tags/${{ github.ref_name }}
owner: Materials-Consortia
repo: optimade-python-tools
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Save branch name
id: save_branch
run: |
echo 'publish_branch=${{ fromJson(steps.get_release_branch.outputs.data).target_commitish }}' >> $GITHUB_OUTPUT

- name: Checkout publish branch
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
branch: ${{ steps.save_branch.outputs.publish_branch }}

- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand All @@ -36,21 +54,26 @@ jobs:
pip install -r requirements.txt -r requirements-dev.txt -r requirements-client.txt -r requirements-http-client.txt -r requirements-docs.txt
pip install -e .[all]

- name: Get base branch name for tag
id: branch_finder
run:
echo "branch=$(git branch --show-current)" >> "$GITHUB_OUTPUT"

- name: Update changelog
uses: CharMixer/auto-changelog-action@v1
with:
token: ${{ secrets.RELEASE_PAT_BOT }}
release_branch: ${{ env.PUBLISH_UPDATE_BRANCH }}
release_branch: ${{ steps.save_branch.outputs.publish_branch }}
exclude_labels: "duplicate,question,invalid,wontfix,dependency_updates,skip_changelog"

- name: Update API Reference docs and version - Commit changes and update tag
run: .github/utils/update_docs.sh

- name: Update '${{ env.PUBLISH_UPDATE_BRANCH }}'
- name: Update triggering branch
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.RELEASE_PAT_BOT }}
branch: ${{ env.PUBLISH_UPDATE_BRANCH }}
branch: ${{ steps.save_branch.outputs.publish_branch }}
unprotect_reviews: true
sleep: 15
force: true
Expand All @@ -63,7 +86,7 @@ jobs:
uses: CharMixer/auto-changelog-action@v1
with:
token: ${{ secrets.RELEASE_PAT_BOT }}
release_branch: ${{ env.PUBLISH_UPDATE_BRANCH }}
release_branch: ${{ steps.save_branch.outputs.publish_branch }}
since_tag: "${{ env.PREVIOUS_VERSION }}"
output: "release_changelog.md"
exclude_labels: "duplicate,question,invalid,wontfix,dependency_updates,skip_changelog"
Expand Down Expand Up @@ -96,10 +119,10 @@ jobs:
with:
submodules: true
fetch-depth: 0
ref: ${{ env.PUBLISH_UPDATE_BRANCH }}
ref: ${{ needs.publish.outputs.publish_branch }}

- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand All @@ -115,18 +138,23 @@ jobs:
git config --global user.name "${{ env.GIT_USER_NAME }}"
git config --global user.email "${{ env.GIT_USER_EMAIL }}"

- name: Deploy documentation
- name: Deploy versioned documentation
run: |
mike deploy --push --remote origin --branch gh-pages --config-file mkdocs.yml ${GITHUB_REF#refs/tags/v}

- name: Deploy stable/latest documentation
if: ${{ needs.publish.outputs.publish_branch }} == ${{ env.DEFAULT_RELEASE_BRANCH }}
run: |
mike deploy --push --remote origin --branch gh-pages --update-aliases --config-file mkdocs.yml ${GITHUB_REF#refs/tags/v} stable
mike deploy --push --remote origin --branch gh-pages --update-aliases --config-file mkdocs.yml latest master
mike deploy --push --remote origin --branch gh-pages --update-aliases --config-file mkdocs.yml latest ${{ env.DEFAULT_RELEASE_BRANCH }}

publish_container_image:
name: Publish container image
needs: publish
uses: ./.github/workflows/cd_container_image.yml
with:
release: true
checkout_ref: master
checkout_ref: ${{ needs.publish.outputs.publish_branch }}
secrets: inherit
permissions:
packages: write
Expand Down
56 changes: 31 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

env:
PYTEST_ADDOPTS: "--color=yes"
LINTING_PY_VERSION: "3.9" # The version of Python to use for linting (typically the minimum supported)

# Cancel running workflows when additional changes are pushed
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value
Expand All @@ -26,10 +27,10 @@ jobs:
with:
submodules: true

- name: Set up Python 3.10
uses: actions/setup-python@v4
- name: Set up Python ${{ env.LINTING_PY_VERSION }}
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: ${{ env.LINTING_PY_VERSION }}
cache: 'pip'
cache-dependency-path: |
requirements*.txt
Expand All @@ -56,10 +57,10 @@ jobs:
with:
submodules: true

- name: Set up Python 3.10
uses: actions/setup-python@v4
- name: Set up Python ${{ env.LINTING_PY_VERSION }}
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: ${{ env.LINTING_PY_VERSION }}
cache: 'pip'
cache-dependency-path: |
requirements*.txt
Expand Down Expand Up @@ -131,7 +132,7 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']

services:
mongo:
Expand Down Expand Up @@ -167,7 +168,7 @@ jobs:
fetch-depth: 2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand All @@ -184,25 +185,25 @@ jobs:
pip install -r requirements-http-client.txt

- name: Run non-server tests
run: pytest -rs -vvv --cov=./optimade/ --cov-report=xml tests/ --ignore tests/server
run: pytest -rs -vvv --durations=0 --cov=./optimade/ --cov-report=xml tests/ --ignore tests/server

- name: Install latest server dependencies
run: pip install -r requirements-server.txt

- name: Run server tests (using `mongomock`)
run: pytest -rs -vvv --cov=./optimade/ --cov-report=xml --cov-append tests/server tests/filtertransformers
run: pytest -rs -vvv --durations=0 --cov=./optimade/ --cov-report=xml --cov-append tests/server tests/filtertransformers
env:
OPTIMADE_DATABASE_BACKEND: 'mongomock'

- name: Run server tests with no API validation (using `mongomock`)
run:
pytest -rs -vvv --cov=./optimade/ --cov-report=xml --cov-append tests/server tests/filtertransformers
pytest -rs -vvv --durations=0 --cov=./optimade/ --cov-report=xml --cov-append tests/server tests/filtertransformers
env:
OPTIMADE_DATABASE_BACKEND: 'mongomock'
OPTIMADE_VALIDATE_API_RESPONSE: false

- name: Run server tests (using a real MongoDB)
run: pytest -rs -vvv --cov=./optimade/ --cov-report=xml --cov-append tests/server tests/filtertransformers
run: pytest -rs -vvv --durations=0 --cov=./optimade/ --cov-report=xml --cov-append tests/server tests/filtertransformers
env:
OPTIMADE_DATABASE_BACKEND: 'mongodb'

Expand All @@ -227,36 +228,38 @@ jobs:
run: pytest -rs -vvv --cov=./optimade/ --cov-report=xml --cov-append tests/adapters/

- name: Run tests for validator only to assess coverage (mongomock)
if: matrix.python-version == 3.10
if: matrix.python-version == '3.11'
run: pytest -rs --cov=./optimade/ --cov-report=xml:validator_cov.xml --cov-append tests/server/test_server_validation.py
env:
OPTIMADE_DATABASE_BACKEND: 'mongomock'

- name: Run tests for validator only to assess coverage (Elasticsearch)
if: matrix.python-version == 3.10
if: matrix.python-version == '3.11'
run: pytest -rs --cov=./optimade/ --cov-report=xml:validator_cov.xml --cov-append tests/server/test_server_validation.py
env:
OPTIMADE_DATABASE_BACKEND: 'elastic'
OPTIMADE_INSERT_TEST_DATA: false # Must be specified as previous steps will have already inserted the test data

- name: Run tests for validator only to assess coverage (MongoDB)
if: matrix.python-version == 3.10
if: matrix.python-version == '3.11'
run: pytest -rs --cov=./optimade/ --cov-report=xml:validator_cov.xml --cov-append tests/server/test_server_validation.py
env:
OPTIMADE_DATABASE_BACKEND: 'mongodb'
OPTIMADE_INSERT_TEST_DATA: false # Must be specified as previous steps will have already inserted the test data

- name: Run the OPTIMADE Client CLI
if: matrix.python-version == 3.10
if: matrix.python-version == '3.11'
run: |
coverage run --append --source optimade optimade/client/cli.py \
--filter 'nsites = 1' \
--http-timeout 1.0 \
--output-file test_get_async.json \
https://optimade.fly.dev
test test_get_async.json

coverage run --append --source optimade optimade/client/cli.py \
--filter 'nsites = 1' \
--http-timeout 1.0 \
--count \
--output-file test_count.json \
https://optimade.fly.dev
Expand All @@ -265,6 +268,7 @@ jobs:
coverage run --append --source optimade optimade/client/cli.py \
--no-async \
--filter 'nsites = 1' \
--http-timeout 1.0 \
--count \
--output-file test_count_no_async.json \
https://optimade.fly.dev
Expand All @@ -275,17 +279,19 @@ jobs:
coverage xml

- name: Upload coverage to Codecov
if: matrix.python-version == '3.10' && github.repository == 'Materials-Consortia/optimade-python-tools'
uses: codecov/codecov-action@v3
if: matrix.python-version == '3.11' && github.repository == 'Materials-Consortia/optimade-python-tools'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: project
file: ./coverage.xml
flags: project

- name: Upload validator coverage to Codecov
if: matrix.python-version == '3.10' && github.repository == 'Materials-Consortia/optimade-python-tools'
uses: codecov/codecov-action@v3
if: matrix.python-version == '3.11' && github.repository == 'Materials-Consortia/optimade-python-tools'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: validator
file: ./validator_cov.xml
flags: validator
Expand All @@ -298,9 +304,9 @@ jobs:
with:
submodules: true

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: ${{ env.LINTING_PY_VERSION }}
cache: 'pip'
cache-dependency-path: |
requirements*.txt
Expand Down Expand Up @@ -330,10 +336,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v4
- name: Set up Python ${{ env.LINTING_PY_VERSION }}
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: ${{ env.LINTING_PY_VERSION }}
cache: 'pip'
cache-dependency-path: |
requirements*.txt
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/ci_cd_updated_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ jobs:
fetch-depth: 0
submodules: true

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

- name: Install dependencies
if: env.RELEASE_RUN == 'false'
Expand Down Expand Up @@ -138,8 +138,6 @@ jobs:
deploy-fly:
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
OPTIMADE_CONFIG_FILE: /app/tests/test_config.json
OPTIMADE_BASE_URL: https://optimade.fly.dev
runs-on: ubuntu-latest
if: github.repository_owner == 'Materials-Consortia'
steps:
Expand All @@ -152,6 +150,10 @@ jobs:
- name: Set up Fly
uses: superfly/flyctl-actions/setup-flyctl@master

- name: Combine requirements for builder
run: |
cat requirements-server.txt >> requirements.txt

- name: Deploy to Fly
run: flyctl deploy --remote-only -c ./.github/fly.toml

Expand Down
Loading