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

JPBergsma/partial data #1812

Draft
wants to merge 107 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
107 commits
Select commit Hold shift + click to select a range
eecc878
Addded meta field to entry model
JPBergsma Jul 6, 2023
6ed4a5d
Added validator for meta field.
JPBergsma Jul 19, 2023
5e0ace4
Merge branch 'master' into JPBergsma/add_metadata
JPBergsma Jul 19, 2023
ef1ca3c
Update pyyaml version in requirements.txt
JPBergsma Jul 20, 2023
89ac0fe
Update requirements.txt
JPBergsma Jul 20, 2023
f229be1
Update requirements.txt
JPBergsma Jul 20, 2023
fcc501c
Merge branch 'master' into JPBergsma/add_metadata
JPBergsma Jul 20, 2023
a195fb5
Remove test structures to get an idea of what triggers yaml import er…
JPBergsma Jul 20, 2023
07d77fe
Readding meta field to test_good_structures.
JPBergsma Jul 20, 2023
2848dd3
Readding meta field to test_structures.json.
JPBergsma Jul 20, 2023
80c4dc4
Added handling None for property_metadata to validator + small correc…
JPBergsma Jul 21, 2023
d55abec
Added test for validator per entry meta field.
JPBergsma Jul 21, 2023
ff545bb
Added test for presence metadata field in test_structures.py.
JPBergsma Jul 21, 2023
e0d6ff3
Remove metadata fields when the fields that they belong to are not re…
JPBergsma Jul 21, 2023
191fbba
add extra test for bad prefix.
JPBergsma Jul 21, 2023
8764e34
Merge branch 'master' into JPBergsma/add_metadata
JPBergsma Jul 25, 2023
6251e48
Test if dependancy conflict causes error.
JPBergsma Jul 25, 2023
c6be5ca
Merge branch 'master' into JPBergsma/add_metadata
JPBergsma Jul 25, 2023
bf9692a
Revert "Test if dependancy conflict causes error."
JPBergsma Jul 25, 2023
0864911
Revert "Revert "Test if dependancy conflict causes error.""
JPBergsma Jul 25, 2023
03f91f1
Merge branch 'JPBergsma/add_metadata' of https://github.com/JPBergsma…
JPBergsma Jul 25, 2023
eb953ad
correct version httpx.
JPBergsma Jul 26, 2023
2879fac
commenting out validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
18e2ef1
Slowly reassembling validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
7fc1906
Slowly reassembling validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
b622414
Slowly reassembling validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
95bf11b
Slowly reassembling validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
7c02f38
Slowly reassembling validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
2b52248
Slowly reassembling validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
20e228d
Slowly reassembling validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
7be2a0f
Slowly reassembling validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
bffb5d1
Slowly reassembling validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
1f0bbb9
Slowly reassembling validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
7c0a8be
Slowly reassembling validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
456f34f
Slowly reassembling validator to see if this resolves issue github.
JPBergsma Jul 26, 2023
9603277
Slowly reassembling validator to see if this resolves issue Github.
JPBergsma Jul 26, 2023
c621412
Slowly reassembling validator to see if this resolves issue Github.
JPBergsma Jul 26, 2023
ed44736
Slowly reassembling validator to see if this resolves issue Github..
JPBergsma Jul 26, 2023
4f28acc
Slowly reassembling validator to see if this resolves issue Github..
JPBergsma Jul 26, 2023
63af8dc
Placed yaml import in try except block.
JPBergsma Jul 26, 2023
5b41b71
Added more cases to test data and added bugfix for removing associate…
JPBergsma Aug 2, 2023
f694d15
Removed seemingly unneccesary mypy ignore exception statement.
JPBergsma Aug 2, 2023
5bac762
Merge branch 'master' into JPBergsma/add_metadata
JPBergsma Aug 2, 2023
40ff136
remove change in version pyyaml in requirements.txt.
JPBergsma Aug 2, 2023
8f7ca29
correct spelling mistake
JPBergsma Aug 2, 2023
6a20ef9
moved starts_with_supported_prefix and check_starts_with_supported_pr…
JPBergsma Aug 2, 2023
e95c9b4
Expanded docstring check_starts_with_supported_prefix
JPBergsma Aug 3, 2023
bcd7971
Expanded docstring check_starts_with_supported_prefix
JPBergsma Aug 3, 2023
748bacc
Added return type for starts_with_supported_prefix and check_starts_…
JPBergsma Aug 3, 2023
8430ddd
Added return type for starts_with_supported_prefix and check_starts_…
JPBergsma Aug 3, 2023
ac26f09
Adjusted validators baseed on suggestion Matthew.
JPBergsma Aug 3, 2023
e1c4901
small corrections validators.
JPBergsma Aug 3, 2023
7dab3a7
small correction in removing unrequested metadata.
JPBergsma Aug 3, 2023
da8a026
Added spaces before values 'exmpl_originates_from _project'.
JPBergsma Aug 3, 2023
92da84e
First draft version of model of jsonlines response.
JPBergsma Aug 4, 2023
f39c734
renamed files to partialdata.
JPBergsma Aug 8, 2023
8c889c6
First draft version of model of jsonlines response.
JPBergsma Aug 10, 2023
75669c8
added metadata fields for partial data protocal to entry models.
JPBergsma Aug 14, 2023
9657ff3
Added descriptions for fields partial data links.
JPBergsma Aug 14, 2023
281551e
Storing intermediate code on the way to implement partial data to get…
JPBergsma Aug 22, 2023
115ca61
Merge with master.
JPBergsma Aug 22, 2023
e8bbfe1
First somewhat working version of partial_data endpoint.
JPBergsma Sep 4, 2023
9c0985a
Merge branch 'master' into JPBergsma/Partial_data
JPBergsma Sep 5, 2023
f67555e
Move _check_aliases to it's own subclass so it can be used for both g…
JPBergsma Sep 5, 2023
b7907c9
Merge branch 'master' into optimade_python_tools_trajectory_0.1
JPBergsma Sep 5, 2023
07defa5
Extra todo's and comments after trying to add validator for format fi…
JPBergsma Sep 5, 2023
64b97bd
Fixed validator for format field.
JPBergsma Sep 5, 2023
c908d3f
first minimal version partial data.
JPBergsma Sep 12, 2023
88e4eb9
merge with master
JPBergsma Sep 13, 2023
944d374
merge with master
JPBergsma Sep 13, 2023
04e9ff6
update openapijson
JPBergsma Sep 13, 2023
5368934
update openapijson
JPBergsma Sep 13, 2023
bccbe73
update openapijson
JPBergsma Sep 13, 2023
7a75366
changed 'regex' to 'pattern'.
JPBergsma Sep 14, 2023
c87d436
Moved generate_links_partial_data function to routers/utils.py and ma…
JPBergsma Sep 14, 2023
6746969
Expanded model partial_data.
JPBergsma Sep 24, 2023
63651f1
use lstrip instead of manually removing / one at a time.
JPBergsma Sep 30, 2023
389e679
Update optimade/models/entries.py
JPBergsma Oct 2, 2023
4ec23c9
Update description per entry meta datafield.
JPBergsma Oct 2, 2023
05b2906
Merge branch 'master' into JPBergsma/add_metadata
JPBergsma Oct 3, 2023
1cd73e3
Merge branch 'master' into JPBergsma/add_metadata
JPBergsma Oct 3, 2023
d3b8b22
update openapijson.
JPBergsma Oct 3, 2023
8ae4081
trying to merge with remote.
JPBergsma Oct 3, 2023
68f14d3
try to see if moving yaml is still necessary.
JPBergsma Oct 3, 2023
1d46e1b
Revert "try to see if moving yaml is still necessary."
JPBergsma Oct 3, 2023
774be72
Added supported_prefixes field to config.py
JPBergsma Oct 11, 2023
fac9b9b
Merge branch 'master' of https://github.com/JPBergsma/optimade-python…
JPBergsma Oct 11, 2023
7d790b2
Merge branch 'master' into JPBergsma/add_metadata
JPBergsma Oct 11, 2023
6c85877
Merged latest version metadata branch with partial data branch.
JPBergsma Oct 11, 2023
13fcdc0
Add numpy to requirements.
JPBergsma Oct 12, 2023
3be7d54
Added jsonlines dependancy.
JPBergsma Oct 13, 2023
075ef06
Made changes to make mypy happy.
JPBergsma Oct 13, 2023
ca2a0f2
Trying to determine why jsonlines is not impoeted properly on github.
JPBergsma Oct 13, 2023
cf45488
Update requirements-client.txt (#1813)
JPBergsma Oct 13, 2023
2466fb1
Merge branch 'master' of https://github.com/JPBergsma/optimade-python…
JPBergsma Oct 13, 2023
ff25f14
Merge branch 'master' into JPBergsma/add_metadata
JPBergsma Oct 13, 2023
1dbd07a
Merge branch 'JPBergsma/add_metadata' into JPBergsma/Partial_data
JPBergsma Oct 13, 2023
8510ffa
Modernize all Python 3.8 annotations (#1815)
ml-evs Oct 15, 2023
44d8789
Merging with master.
JPBergsma Oct 17, 2023
563948e
merging with metadata branch
JPBergsma Oct 17, 2023
4fe22a2
backporting bugfixes from of the JPBergsma/trajectory_endpoint branch.
JPBergsma Oct 18, 2023
870018d
Expanded model partial_data.
JPBergsma Sep 24, 2023
da11332
Expanded model partial_data.
JPBergsma Sep 24, 2023
61361b8
Clarified why field is named describedby and not described_by.
JPBergsma Sep 24, 2023
e4c2293
Removed unneccesary empty line
JPBergsma Oct 19, 2023
e04387f
Somehow the line setting the filepointer to 0 has gone missing.
JPBergsma Oct 19, 2023
bf29459
Skip partial_data tests for elastic search for which it has not been …
JPBergsma Oct 19, 2023
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
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
with:
submodules: true

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

- name: Set up Python 3.10
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.9'
cache: 'pip'
cache-dependency-path: |
requirements*.txt
Expand Down Expand Up @@ -227,27 +227,27 @@ 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.9
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.9
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.9
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.9
run: |
coverage run --append --source optimade optimade/client/cli.py \
--filter 'nsites = 1' \
Expand Down Expand Up @@ -275,15 +275,15 @@ jobs:
coverage xml

- name: Upload coverage to Codecov
if: matrix.python-version == '3.10' && github.repository == 'Materials-Consortia/optimade-python-tools'
if: matrix.python-version == '3.9' && github.repository == 'Materials-Consortia/optimade-python-tools'
uses: codecov/codecov-action@v3
with:
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'
if: matrix.python-version == '3.9' && github.repository == 'Materials-Consortia/optimade-python-tools'
uses: codecov/codecov-action@v3
with:
name: validator
Expand All @@ -300,7 +300,7 @@ jobs:

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

- name: Set up Python 3.10
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.9'
cache: 'pip'
cache-dependency-path: |
requirements*.txt
Expand Down
16 changes: 11 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default_language_version:
python: python3.10
python: python3.9

repos:
- repo: https://github.com/ambv/black
Expand All @@ -9,7 +9,7 @@ repos:
name: Blacken

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-symlinks
- id: check-yaml
Expand All @@ -23,11 +23,17 @@ repos:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py39-plus"]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.291'
rev: 'v0.0.292'
hooks:
- id: ruff
args: [--fix]
args: [--fix, --exit-non-zero-on-fix]

- repo: local
hooks:
Expand All @@ -46,7 +52,7 @@ repos:
description: Update the API Reference documentation whenever a Python file is touched in the code base.

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.6.0
hooks:
- id: mypy
name: "MyPy"
Expand Down
3 changes: 3 additions & 0 deletions docs/api_reference/adapters/jsonl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# jsonl

::: optimade.adapters.jsonl
5 changes: 5 additions & 0 deletions docs/api_reference/models/partial_data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# partial_data

::: optimade.models.partial_data
options:
show_if_no_docstring: true
3 changes: 3 additions & 0 deletions docs/api_reference/server/mappers/partial_data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# partial_data

::: optimade.server.mappers.partial_data
3 changes: 3 additions & 0 deletions docs/api_reference/server/routers/partial_data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# partial_data

::: optimade.server.routers.partial_data
54 changes: 50 additions & 4 deletions openapi/index_openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,29 @@
"title": "BaseRelationshipResource",
"description": "Minimum requirements to represent a relationship resource"
},
"EntryMetadata": {
"properties": {
"property_metadata": {
"type": "object",
"title": "Property Metadata",
"description": "An object containing per-entry and per-property metadata. The keys are the names of the fields in attributes for which metadata is available. The values belonging to these keys are dictionaries containing the relevant metadata fields. See also [Metadata properties](https://github.com/Materials-Consortia/OPTIMADE/blob/develop/optimade.rst#metadata-properties)"
},
"partial_data_links": {
"additionalProperties": {
"items": {
"$ref": "#/components/schemas/PartialDataLink"
},
"type": "array"
},
"type": "object",
"title": "Partial Data Links",
"description": "A dictionary, where the keys are the names of the properties in the attributes field for which the value is too large to be shared by default.\n For each property one or more links are provided from which the value of the attribute can be retrieved."
}
},
"type": "object",
"title": "EntryMetadata",
"description": "Contains the metadata for the attributes of an entry"
},
"EntryRelationships": {
"properties": {
"references": {
Expand Down Expand Up @@ -520,11 +543,11 @@
"meta": {
"allOf": [
{
"$ref": "#/components/schemas/Meta"
"$ref": "#/components/schemas/EntryMetadata"
}
],
"title": "Meta",
"description": "a meta object containing non-standard meta-information about a resource that can not be represented as an attribute or relationship."
"description": "A [JSON API meta object](https://jsonapi.org/format/1.1/#document-meta) that is used to communicate metadata."
},
"attributes": {
"allOf": [
Expand Down Expand Up @@ -1129,11 +1152,11 @@
"meta": {
"allOf": [
{
"$ref": "#/components/schemas/Meta"
"$ref": "#/components/schemas/EntryMetadata"
}
],
"title": "Meta",
"description": "a meta object containing non-standard meta-information about a resource that can not be represented as an attribute or relationship."
"description": "A [JSON API meta object](https://jsonapi.org/format/1.1/#document-meta) that is used to communicate metadata."
},
"attributes": {
"allOf": [
Expand Down Expand Up @@ -1393,6 +1416,29 @@
"title": "OptimadeError",
"description": "detail MUST be present"
},
"PartialDataLink": {
"properties": {
"link": {
"type": "string",
"maxLength": 65536,
"minLength": 1,
"format": "uri",
"title": "Link",
"description": "String. A JSON API link that points to a location from which the omitted data can be fetched. There is no requirement on the syntax or format for the link URL."
},
"format": {
"type": "string",
"title": "Format",
"description": "String. The name of the format provided via this link. For one of the objects this format field SHOULD have the value \"jsonlines\", which refers to the format in OPTIMADE JSON lines partial data format."
}
},
"type": "object",
"required": [
"link",
"format"
],
"title": "PartialDataLink"
},
"Provider": {
"properties": {
"name": {
Expand Down
Loading
Loading