Skip to content

Commit

Permalink
Update API schema
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc committed Jan 29, 2024
1 parent de5ceee commit 47c65de
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 25 deletions.
79 changes: 57 additions & 22 deletions docs/_static/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,50 +270,51 @@ components:
mixed:
description: Gets data[5, 0:10:2]
value: [5, '0:10:2']

schemas:
# Metadata schemas
attrMetadata:
type: object
description: Attribute metadata. Does not include the value.
properties:
dtype:
$ref: '#/components/schemas/dtype'
name:
type: string
example: 'attr1_name'
shape:
$ref: '#/components/schemas/shape'
type:
$ref: '#/components/schemas/type'
entityMetadata:
type: object
properties:
kind:
enum: ['other']
type: string
name:
type: string
example: 'entity_name'
type:
enum: ['other']
type: string
softLinkMetadata:
allOf:
- $ref: '#/components/schemas/entityMetadata'
- type: object
properties:
kind:
enum: ['soft_link']
type: string
target_path:
type: string
example: '/path/to/linked/entity'
type:
enum: ['soft_link']
type: string
externalLinkMetadata:
allOf:
- $ref: '#/components/schemas/softLinkMetadata'
- type: object
properties:
target_file:
type: string
type:
kind:
enum: ['external_link']
type: string
example: 'path/to/another/file.h5'
target_file:
type: string
resolvedEntityMetadata:
allOf:
- $ref: '#/components/schemas/entityMetadata'
Expand All @@ -328,25 +329,28 @@ components:
- $ref: '#/components/schemas/resolvedEntityMetadata'
- type: object
properties:
kind:
enum: ['dataset']
type: string
shape:
$ref: '#/components/schemas/shape'
type:
$ref: '#/components/schemas/type'
chunks:
$ref: '#/components/schemas/shape'
dtype:
$ref: '#/components/schemas/dtype'
filters:
type: array
items:
$ref: '#/components/schemas/filterInfo'
nullable: true
shape:
$ref: '#/components/schemas/shape'
type:
enum: ['dataset']
type: string
groupMetadata:
allOf:
- $ref: '#/components/schemas/resolvedEntityMetadata'
- type: object
properties:
kind:
enum: ['group']
type: string
children:
type: array
items:
Expand All @@ -356,18 +360,49 @@ components:
- $ref: '#/components/schemas/externalLinkMetadata'
- $ref: '#/components/schemas/resolvedEntityMetadata'
- $ref: '#/components/schemas/softLinkMetadata'
type:
enum: ['group']
type: string
childGroupMetadata:
allOf:
- $ref: '#/components/schemas/resolvedEntityMetadata'
- type: object
properties:
type:
kind:
enum: ['group']
type: string

# Other schemas
type:
type: object
properties:
class:
type: integer
dtype:
$ref: '#/components/schemas/dtype'
size:
type: integer
order:
type: integer
sign:
type: integer
cset:
type: integer
vlen:
type: boolean
tag:
type: string
dims:
$ref: '#/components/schemas/shape'
dims:
$ref: '#/components/schemas/shape'
members:
oneOf:
- type: object
additionalProperties:
$ref: '#/components/schemas/type'
- type: object
additionalProperties:
type: integer
base:
$ref: '#/components/schemas/type'
dtype:
oneOf:
- type: 'string'
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# -- Project information -----------------------------------------------------

project = "h5grove"
copyright = "2021, ESRF"
copyright = "2024, ESRF"
author = "ESRF"

# The full version, including alpha/beta/rc tags
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dev =
myst-parser
# Needed for fastapi tests. Could be removed by setting fastapi[all] as dep in the future.
httpx >= 0.23
pydantic_settings
pydantic-settings
pytest
pytest-benchmark
pytest-cov
Expand Down
2 changes: 1 addition & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test(c, verbose=False, keyword="", cov_lines=False):
c.run(
"pytest --benchmark-skip"
+ (" -vv" if verbose else "")
+ ((" -k" + keyword) if keyword else "")
+ (f" -k{keyword}" if keyword else "")
+ (" --cov-report term-missing" if cov_lines else "")
)

Expand Down

0 comments on commit 47c65de

Please sign in to comment.