From 97135c14f24503b03c6baee1bbad14dad0e6b23a Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Mon, 2 Sep 2024 18:46:02 -0700 Subject: [PATCH] update models to correctly handle ElementIdentifiers --- nwb_linkml/src/nwb_linkml/adapters/dataset.py | 6 +++++- nwb_linkml/src/nwb_linkml/adapters/namespaces.py | 3 ++- nwb_linkml/src/nwb_linkml/io/schema.py | 2 ++ nwb_linkml/src/nwb_linkml/providers/linkml.py | 1 + nwb_linkml/src/nwb_linkml/providers/pydantic.py | 2 +- nwb_linkml/src/nwb_linkml/providers/schema.py | 2 +- .../models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py | 4 ++++ .../models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py | 4 ++++ .../models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py | 4 ++++ .../models/pydantic/hdmf_common/v1_2_0/hdmf_common_table.py | 4 ++++ .../models/pydantic/hdmf_common/v1_2_1/hdmf_common_table.py | 4 ++++ .../models/pydantic/hdmf_common/v1_3_0/hdmf_common_table.py | 4 ++++ .../models/pydantic/hdmf_common/v1_4_0/hdmf_common_table.py | 4 ++++ .../models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py | 4 ++++ .../models/pydantic/hdmf_common/v1_5_1/hdmf_common_table.py | 4 ++++ .../models/pydantic/hdmf_common/v1_6_0/hdmf_common_table.py | 4 ++++ .../models/pydantic/hdmf_common/v1_7_0/hdmf_common_table.py | 4 ++++ .../models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py | 4 ++++ .../schema/linkml/hdmf_common/v1_1_0/hdmf-common.table.yaml | 6 ++++++ .../schema/linkml/hdmf_common/v1_1_2/hdmf-common.table.yaml | 6 ++++++ .../schema/linkml/hdmf_common/v1_1_3/hdmf-common.table.yaml | 6 ++++++ .../schema/linkml/hdmf_common/v1_2_0/hdmf-common.table.yaml | 6 ++++++ .../schema/linkml/hdmf_common/v1_2_1/hdmf-common.table.yaml | 6 ++++++ .../schema/linkml/hdmf_common/v1_3_0/hdmf-common.table.yaml | 6 ++++++ .../schema/linkml/hdmf_common/v1_4_0/hdmf-common.table.yaml | 6 ++++++ .../schema/linkml/hdmf_common/v1_5_0/hdmf-common.table.yaml | 6 ++++++ .../schema/linkml/hdmf_common/v1_5_1/hdmf-common.table.yaml | 6 ++++++ .../schema/linkml/hdmf_common/v1_6_0/hdmf-common.table.yaml | 6 ++++++ .../schema/linkml/hdmf_common/v1_7_0/hdmf-common.table.yaml | 6 ++++++ .../schema/linkml/hdmf_common/v1_8_0/hdmf-common.table.yaml | 6 ++++++ scripts/generate_core.py | 6 ------ 31 files changed, 132 insertions(+), 10 deletions(-) diff --git a/nwb_linkml/src/nwb_linkml/adapters/dataset.py b/nwb_linkml/src/nwb_linkml/adapters/dataset.py index ef5eb61..592b004 100644 --- a/nwb_linkml/src/nwb_linkml/adapters/dataset.py +++ b/nwb_linkml/src/nwb_linkml/adapters/dataset.py @@ -430,6 +430,10 @@ class MapArrayLikeAttributes(DatasetMap): The most general case - treat everything that isn't handled by one of the special cases as an array! + We specifically include classes that have no attributes but also don't have a name, + as they still require their own class (unlike :class:`.MapArrayLike` above, where we + just generate an anonymous slot.) + Examples: .. adapter:: DatasetAdapter @@ -525,7 +529,7 @@ class MapArrayLikeAttributes(DatasetMap): return ( all([cls.dims, cls.shape]) and cls.neurodata_type_inc != "VectorData" - and has_attrs(cls) + and (has_attrs(cls) or not cls.name) and not is_compound(cls) and (dtype == "AnyType" or dtype in flat_to_linkml) ) diff --git a/nwb_linkml/src/nwb_linkml/adapters/namespaces.py b/nwb_linkml/src/nwb_linkml/adapters/namespaces.py index 266906e..ddacb52 100644 --- a/nwb_linkml/src/nwb_linkml/adapters/namespaces.py +++ b/nwb_linkml/src/nwb_linkml/adapters/namespaces.py @@ -56,6 +56,8 @@ class NamespacesAdapter(Adapter): needed_adapter = NamespacesAdapter.from_yaml(needed_source_ns) ns_adapter.imported.append(needed_adapter) + ns_adapter.populate_imports() + return ns_adapter def build( @@ -176,7 +178,6 @@ class NamespacesAdapter(Adapter): else: raise KeyError(f"No schema found that define {name}") - @model_validator(mode="after") def populate_imports(self) -> "NamespacesAdapter": """ Populate the imports that are needed for each schema file diff --git a/nwb_linkml/src/nwb_linkml/io/schema.py b/nwb_linkml/src/nwb_linkml/io/schema.py index 42718f5..8f960c7 100644 --- a/nwb_linkml/src/nwb_linkml/io/schema.py +++ b/nwb_linkml/src/nwb_linkml/io/schema.py @@ -131,6 +131,8 @@ def load_namespace_adapter( else: adapter = NamespacesAdapter(namespaces=namespaces, schemas=sch) + adapter.populate_imports() + return adapter diff --git a/nwb_linkml/src/nwb_linkml/providers/linkml.py b/nwb_linkml/src/nwb_linkml/providers/linkml.py index 4af2bec..fe8dec5 100644 --- a/nwb_linkml/src/nwb_linkml/providers/linkml.py +++ b/nwb_linkml/src/nwb_linkml/providers/linkml.py @@ -127,6 +127,7 @@ class LinkMLProvider(Provider): for schema_needs in adapter.needed_imports.values(): for needed in schema_needs: adapter.imported.append(ns_adapters[needed]) + adapter.populate_imports() # then do the build res = {} diff --git a/nwb_linkml/src/nwb_linkml/providers/pydantic.py b/nwb_linkml/src/nwb_linkml/providers/pydantic.py index 5d5975c..c44c85c 100644 --- a/nwb_linkml/src/nwb_linkml/providers/pydantic.py +++ b/nwb_linkml/src/nwb_linkml/providers/pydantic.py @@ -278,7 +278,7 @@ class PydanticProvider(Provider): nwb_models.models.pydantic.{namespace}.{version} """ name_pieces = [ - "nwb_linkml", + "nwb_models", "models", "pydantic", module_case(namespace), diff --git a/nwb_linkml/src/nwb_linkml/providers/schema.py b/nwb_linkml/src/nwb_linkml/providers/schema.py index adadb00..7555f93 100644 --- a/nwb_linkml/src/nwb_linkml/providers/schema.py +++ b/nwb_linkml/src/nwb_linkml/providers/schema.py @@ -131,7 +131,7 @@ class SchemaProvider(Provider): results = {} for ns, ns_result in linkml_res.items(): results[ns] = pydantic_provider.build( - ns_result["namespace"], versions=self.versions, **pydantic_kwargs + ns_result.namespace, versions=self.versions, **pydantic_kwargs ) return results diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py index fb5ae6f..418db3a 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py @@ -866,6 +866,10 @@ class ElementIdentifiers(Data): name: str = Field( "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} ) + value: Optional[NDArray[Shape["* num_elements"], int]] = Field( + None, + json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_elements"}]}}}, + ) class DynamicTableRegion(DynamicTableRegionMixin, VectorData): diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py index 50f164b..b14e78b 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py @@ -866,6 +866,10 @@ class ElementIdentifiers(Data): name: str = Field( "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} ) + value: Optional[NDArray[Shape["* num_elements"], int]] = Field( + None, + json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_elements"}]}}}, + ) class DynamicTableRegion(DynamicTableRegionMixin, VectorData): diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py index 0d16b55..9b19ed4 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py @@ -877,6 +877,10 @@ class ElementIdentifiers(Data): name: str = Field( "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} ) + value: Optional[NDArray[Shape["* num_elements"], int]] = Field( + None, + json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_elements"}]}}}, + ) class DynamicTableRegion(DynamicTableRegionMixin, VectorData): diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_0/hdmf_common_table.py index 647bc23..adfbb51 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_0/hdmf_common_table.py @@ -858,6 +858,10 @@ class ElementIdentifiers(Data): name: str = Field( "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} ) + value: Optional[NDArray[Shape["* num_elements"], int]] = Field( + None, + json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_elements"}]}}}, + ) class DynamicTableRegion(DynamicTableRegionMixin, VectorData): diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_1/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_1/hdmf_common_table.py index d1c0692..f4b94c4 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_1/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_1/hdmf_common_table.py @@ -858,6 +858,10 @@ class ElementIdentifiers(Data): name: str = Field( "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} ) + value: Optional[NDArray[Shape["* num_elements"], int]] = Field( + None, + json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_elements"}]}}}, + ) class DynamicTableRegion(DynamicTableRegionMixin, VectorData): diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_3_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_3_0/hdmf_common_table.py index ece0532..8c1c9dc 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_3_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_3_0/hdmf_common_table.py @@ -858,6 +858,10 @@ class ElementIdentifiers(Data): name: str = Field( "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} ) + value: Optional[NDArray[Shape["* num_elements"], int]] = Field( + None, + json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_elements"}]}}}, + ) class DynamicTableRegion(DynamicTableRegionMixin, VectorData): diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_4_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_4_0/hdmf_common_table.py index d1202ef..f743efc 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_4_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_4_0/hdmf_common_table.py @@ -858,6 +858,10 @@ class ElementIdentifiers(Data): name: str = Field( "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} ) + value: Optional[NDArray[Shape["* num_elements"], int]] = Field( + None, + json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_elements"}]}}}, + ) class DynamicTableRegion(DynamicTableRegionMixin, VectorData): diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py index c1b61d9..ebf5d92 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py @@ -858,6 +858,10 @@ class ElementIdentifiers(Data): name: str = Field( "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} ) + value: Optional[NDArray[Shape["* num_elements"], int]] = Field( + None, + json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_elements"}]}}}, + ) class DynamicTableRegion(DynamicTableRegionMixin, VectorData): diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_1/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_1/hdmf_common_table.py index 4a91362..d4de085 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_1/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_1/hdmf_common_table.py @@ -858,6 +858,10 @@ class ElementIdentifiers(Data): name: str = Field( "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} ) + value: Optional[NDArray[Shape["* num_elements"], int]] = Field( + None, + json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_elements"}]}}}, + ) class DynamicTableRegion(DynamicTableRegionMixin, VectorData): diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_6_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_6_0/hdmf_common_table.py index da5a37f..0fe3368 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_6_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_6_0/hdmf_common_table.py @@ -858,6 +858,10 @@ class ElementIdentifiers(Data): name: str = Field( "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} ) + value: Optional[NDArray[Shape["* num_elements"], int]] = Field( + None, + json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_elements"}]}}}, + ) class DynamicTableRegion(DynamicTableRegionMixin, VectorData): diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_7_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_7_0/hdmf_common_table.py index 9638faa..d94b2dd 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_7_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_7_0/hdmf_common_table.py @@ -858,6 +858,10 @@ class ElementIdentifiers(Data): name: str = Field( "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} ) + value: Optional[NDArray[Shape["* num_elements"], int]] = Field( + None, + json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_elements"}]}}}, + ) class DynamicTableRegion(DynamicTableRegionMixin, VectorData): diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py index b62156a..9440453 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py @@ -858,6 +858,10 @@ class ElementIdentifiers(Data): name: str = Field( "element_id", json_schema_extra={"linkml_meta": {"ifabsent": "string(element_id)"}} ) + value: Optional[NDArray[Shape["* num_elements"], int]] = Field( + None, + json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_elements"}]}}}, + ) class DynamicTableRegion(DynamicTableRegionMixin, VectorData): diff --git a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_1_0/hdmf-common.table.yaml b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_1_0/hdmf-common.table.yaml index 27a272c..a38fa1a 100644 --- a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_1_0/hdmf-common.table.yaml +++ b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_1_0/hdmf-common.table.yaml @@ -86,6 +86,12 @@ classes: ifabsent: string(element_id) range: string required: true + value: + name: value + array: + dimensions: + - alias: num_elements + range: int tree_root: true DynamicTableRegion: name: DynamicTableRegion diff --git a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_1_2/hdmf-common.table.yaml b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_1_2/hdmf-common.table.yaml index fe82d7d..a668487 100644 --- a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_1_2/hdmf-common.table.yaml +++ b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_1_2/hdmf-common.table.yaml @@ -86,6 +86,12 @@ classes: ifabsent: string(element_id) range: string required: true + value: + name: value + array: + dimensions: + - alias: num_elements + range: int tree_root: true DynamicTableRegion: name: DynamicTableRegion diff --git a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_1_3/hdmf-common.table.yaml b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_1_3/hdmf-common.table.yaml index 4285b03..1022ebf 100644 --- a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_1_3/hdmf-common.table.yaml +++ b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_1_3/hdmf-common.table.yaml @@ -114,6 +114,12 @@ classes: ifabsent: string(element_id) range: string required: true + value: + name: value + array: + dimensions: + - alias: num_elements + range: int tree_root: true DynamicTableRegion: name: DynamicTableRegion diff --git a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_2_0/hdmf-common.table.yaml b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_2_0/hdmf-common.table.yaml index 7746e8e..e7f4d41 100644 --- a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_2_0/hdmf-common.table.yaml +++ b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_2_0/hdmf-common.table.yaml @@ -87,6 +87,12 @@ classes: ifabsent: string(element_id) range: string required: true + value: + name: value + array: + dimensions: + - alias: num_elements + range: int tree_root: true DynamicTableRegion: name: DynamicTableRegion diff --git a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_2_1/hdmf-common.table.yaml b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_2_1/hdmf-common.table.yaml index 2ce11ab..b506697 100644 --- a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_2_1/hdmf-common.table.yaml +++ b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_2_1/hdmf-common.table.yaml @@ -87,6 +87,12 @@ classes: ifabsent: string(element_id) range: string required: true + value: + name: value + array: + dimensions: + - alias: num_elements + range: int tree_root: true DynamicTableRegion: name: DynamicTableRegion diff --git a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_3_0/hdmf-common.table.yaml b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_3_0/hdmf-common.table.yaml index cae8e9e..94bb9f7 100644 --- a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_3_0/hdmf-common.table.yaml +++ b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_3_0/hdmf-common.table.yaml @@ -87,6 +87,12 @@ classes: ifabsent: string(element_id) range: string required: true + value: + name: value + array: + dimensions: + - alias: num_elements + range: int tree_root: true DynamicTableRegion: name: DynamicTableRegion diff --git a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_4_0/hdmf-common.table.yaml b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_4_0/hdmf-common.table.yaml index a88c85f..e3f3be3 100644 --- a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_4_0/hdmf-common.table.yaml +++ b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_4_0/hdmf-common.table.yaml @@ -87,6 +87,12 @@ classes: ifabsent: string(element_id) range: string required: true + value: + name: value + array: + dimensions: + - alias: num_elements + range: int tree_root: true DynamicTableRegion: name: DynamicTableRegion diff --git a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_5_0/hdmf-common.table.yaml b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_5_0/hdmf-common.table.yaml index 2652e1c..94ba93b 100644 --- a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_5_0/hdmf-common.table.yaml +++ b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_5_0/hdmf-common.table.yaml @@ -87,6 +87,12 @@ classes: ifabsent: string(element_id) range: string required: true + value: + name: value + array: + dimensions: + - alias: num_elements + range: int tree_root: true DynamicTableRegion: name: DynamicTableRegion diff --git a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_5_1/hdmf-common.table.yaml b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_5_1/hdmf-common.table.yaml index cb79bbe..0047b7c 100644 --- a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_5_1/hdmf-common.table.yaml +++ b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_5_1/hdmf-common.table.yaml @@ -87,6 +87,12 @@ classes: ifabsent: string(element_id) range: string required: true + value: + name: value + array: + dimensions: + - alias: num_elements + range: int tree_root: true DynamicTableRegion: name: DynamicTableRegion diff --git a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_6_0/hdmf-common.table.yaml b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_6_0/hdmf-common.table.yaml index 5240bc3..7cf669d 100644 --- a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_6_0/hdmf-common.table.yaml +++ b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_6_0/hdmf-common.table.yaml @@ -87,6 +87,12 @@ classes: ifabsent: string(element_id) range: string required: true + value: + name: value + array: + dimensions: + - alias: num_elements + range: int tree_root: true DynamicTableRegion: name: DynamicTableRegion diff --git a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_7_0/hdmf-common.table.yaml b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_7_0/hdmf-common.table.yaml index c20fdb3..e1e7b63 100644 --- a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_7_0/hdmf-common.table.yaml +++ b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_7_0/hdmf-common.table.yaml @@ -87,6 +87,12 @@ classes: ifabsent: string(element_id) range: string required: true + value: + name: value + array: + dimensions: + - alias: num_elements + range: int tree_root: true DynamicTableRegion: name: DynamicTableRegion diff --git a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_8_0/hdmf-common.table.yaml b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_8_0/hdmf-common.table.yaml index cf14321..a47fd09 100644 --- a/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_8_0/hdmf-common.table.yaml +++ b/nwb_models/src/nwb_models/schema/linkml/hdmf_common/v1_8_0/hdmf-common.table.yaml @@ -87,6 +87,12 @@ classes: ifabsent: string(element_id) range: string required: true + value: + name: value + array: + dimensions: + - alias: num_elements + range: int tree_root: true DynamicTableRegion: name: DynamicTableRegion diff --git a/scripts/generate_core.py b/scripts/generate_core.py index 221aeaf..aa07dd5 100644 --- a/scripts/generate_core.py +++ b/scripts/generate_core.py @@ -171,17 +171,11 @@ def generate_versions( shutil.rmtree(tmp_dir / "linkml") shutil.rmtree(tmp_dir / "pydantic") - # import the most recent version of the schemaz we built - latest_version = sorted((pydantic_path / "core").glob("v*"), key=os.path.getmtime)[-1] - # make inits to use the schema! we don't usually do this in the # provider class because we directly import the files there. with open(pydantic_path / "__init__.py", "w") as initfile: initfile.write(" ") - with open(pydantic_path / "__init__.py", "w") as initfile: - initfile.write(f"from .pydantic.core.{latest_version.name}.namespace import *") - subprocess.run(["black", "."]) finally: