Skip to content

Implement Dynamictable #6

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

Merged
merged 61 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
d118477
add dynamictable, vectordata, vectorindex mixins
sneakers-the-rat Jul 31, 2024
abf1b0e
update hdmf models/schema
sneakers-the-rat Jul 31, 2024
38e8a6f
lint
sneakers-the-rat Jul 31, 2024
776078a
add pandas
sneakers-the-rat Jul 31, 2024
1d527d8
fix hdmf forwardrefs, remove numpy types temporarily
sneakers-the-rat Jul 31, 2024
0d10ba9
regenerate models, lint
sneakers-the-rat Jul 31, 2024
2fef717
fix attr access in linkml provider result
sneakers-the-rat Jul 31, 2024
66369c7
no op to update github cache?
sneakers-the-rat Jul 31, 2024
b2d7b12
update numpydantic version and relock
sneakers-the-rat Jul 31, 2024
9bfee35
make names less lengthy by only contatenating one layer of nesting wi…
sneakers-the-rat Aug 5, 2024
e72c860
update models with shorter names
sneakers-the-rat Aug 5, 2024
b3b5b9d
unify naming of derived child groups, arrays, and values as just all …
sneakers-the-rat Aug 5, 2024
0a150d6
update models
sneakers-the-rat Aug 5, 2024
374bd89
fix name array -> value in hdmf mixins
sneakers-the-rat Aug 6, 2024
652ddb3
update hdmf common table
sneakers-the-rat Aug 6, 2024
da6d0d8
correctly handle attributes
sneakers-the-rat Aug 6, 2024
e5d1cc5
regenerate models
sneakers-the-rat Aug 6, 2024
c06859a
first impl of dynamictable working!
sneakers-the-rat Aug 6, 2024
51ceb14
regenerate models
sneakers-the-rat Aug 6, 2024
83dd59d
lint!
sneakers-the-rat Aug 6, 2024
6431afa
update tests
sneakers-the-rat Aug 6, 2024
c2e663e
fuckin LINT
sneakers-the-rat Aug 6, 2024
fbb06da
use coveralls action
sneakers-the-rat Aug 6, 2024
a11d3d0
working ragged array indexing before rebuilding models
sneakers-the-rat Aug 7, 2024
a309c25
regenerate model, lint
sneakers-the-rat Aug 7, 2024
edea802
remove dask, nptyping
sneakers-the-rat Aug 7, 2024
3ee7c68
fix array casting for dtypes that have a shape attr but nothing in it
sneakers-the-rat Aug 7, 2024
a993ee1
continue removing nptyping, actually fix indexing
sneakers-the-rat Aug 7, 2024
a990948
my god it works but what have i done
sneakers-the-rat Aug 7, 2024
9e7c533
oop
sneakers-the-rat Aug 7, 2024
362965d
correct test for equality for series
sneakers-the-rat Aug 8, 2024
cebb219
actually fix indexing
sneakers-the-rat Aug 8, 2024
92d28ba
coercion for extra columns passed as arrays
sneakers-the-rat Aug 8, 2024
54c18e3
initial draft of aligned dynamic table before testing and refining. s…
sneakers-the-rat Aug 8, 2024
c09b633
lint
sneakers-the-rat Aug 8, 2024
0452a43
add logging. less janky adapter instantiation using model validators.…
sneakers-the-rat Aug 13, 2024
994b79e
actually no that's stupid, linkml handles inheritance except for the …
sneakers-the-rat Aug 13, 2024
dd99ac2
regenerate models
sneakers-the-rat Aug 13, 2024
06a18c2
working aligned dynamic table and TimeSeriesReferenceVectorData
sneakers-the-rat Aug 13, 2024
6c07b87
regenerate models
sneakers-the-rat Aug 13, 2024
0a93195
lint
sneakers-the-rat Aug 13, 2024
9bd3634
eager resolution of hdmf namespace when loaded from yaml
sneakers-the-rat Aug 14, 2024
1715043
lint
sneakers-the-rat Aug 14, 2024
50005d3
fuckin codespell.
sneakers-the-rat Aug 14, 2024
01e46f7
Make VectorData and VectorIndex generics to ensure coercion to Vector…
sneakers-the-rat Aug 14, 2024
980db25
regenerate models
sneakers-the-rat Aug 14, 2024
43ff350
more texts. Fix coercion with ndarrays and vectordata, incl numpydant…
sneakers-the-rat Aug 14, 2024
d61d1ec
regenerate models
sneakers-the-rat Aug 14, 2024
5780947
indexing tests, fix for pytest 8, logging tests
sneakers-the-rat Aug 14, 2024
b610f32
vectordata indexing tests
sneakers-the-rat Aug 14, 2024
7cb8eea
lint
sneakers-the-rat Aug 14, 2024
36add1a
region tests
sneakers-the-rat Aug 15, 2024
b601027
lint
sneakers-the-rat Aug 15, 2024
54409c7
codespell istg
sneakers-the-rat Aug 15, 2024
7e7cbc1
fix setattr for index and data
sneakers-the-rat Aug 15, 2024
ce096db
aligned dynamictable tests
sneakers-the-rat Aug 15, 2024
1096574
regenerate models
sneakers-the-rat Aug 15, 2024
24494b8
reference vector series tests, fix model tests
sneakers-the-rat Aug 15, 2024
f5a4173
update models
sneakers-the-rat Aug 15, 2024
3cda6c3
lint
sneakers-the-rat Aug 15, 2024
ec7a825
fix tsrv test
sneakers-the-rat Aug 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Lint

on:
push:
branches:
- main
pull_request:
branches: [main]

Expand Down
27 changes: 22 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
Expand Down Expand Up @@ -34,8 +39,20 @@ jobs:
run: pytest
working-directory: nwb_linkml

- name: Report coverage
working-directory: nwb_linkml
run: "coveralls --service=github"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Coveralls Parallel
uses: coverallsapp/[email protected]
if: runner.os != 'macOS'
with:
flag-name: run-${{ join(matrix.*, '-') }}
parallel: true
debug: true

finish-coverage:
needs: test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/[email protected]
with:
parallel-finished: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Translating NWB schema language to linkml

Just submitting to pypi to squat the package name

[![Coverage Status](https://coveralls.io/repos/github/p2p-ld/nwb-linkml/badge.svg)](https://coveralls.io/github/p2p-ld/nwb-linkml)
[![Coverage Status](https://coveralls.io/repos/github/p2p-ld/nwb-linkml/badge.svg)](https://coveralls.io/github/p2p-ld/nwb-linkml)
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ api/nwb_linkml/schema/index

meta/todo
meta/changelog
meta/references
genindex
```

Expand Down
36 changes: 34 additions & 2 deletions docs/intro/translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@

### DynamicTable

```{note}
See the [DynamicTable](https://hdmf-common-schema.readthedocs.io/en/stable/format_description.html#dynamictable)
reference docs
```

One of the major special cases in NWB is the use of `DynamicTable` to contain tabular data that
contains columns that are not in the base spec.

Expand Down Expand Up @@ -284,8 +289,35 @@ When generating pydantic models we...

There are several different ways to create references between objects in nwb/hdmf:

- ...

- [`links`](https://schema-language.readthedocs.io/en/latest/description.html#sec-link-spec) are group-level
properties that can reference other groups or datasets like this:
```yaml
links:
- name: Link name
doc: Required string with the description of the link
target_type: Type of target
quantity: Optional quantity identifier for the group (default=1).
```
- [Reference `dtype`](https://schema-language.readthedocs.io/en/latest/description.html#reference-dtype)s are
dataset, and attribute-level properties that can reference both other objects and regions within other objects:
```yaml
dtype:
target_type: ElectrodeGroup
reftype: object
```
- `TimeSeriesReferenceVectorData` is a compound dtype that behaves like VectorData and VectorIndex combined
into a single type. It is slightly different in that each row of the vector can refer to a different table,
and has a different way of handling selection (with `start` and `count`
rather than a series of indices for the end of each cell)
- Implicitly, hdmf creates references between objects according to some naming conventions, eg.
an attribute/dataset that is a `VectorIndex` named `mydata_index` will be linked to a `VectorData`
object `mydata`.
- There is currently a note in the schema language docs that there will be an additional
[Relationships](https://schema-language.readthedocs.io/en/latest/description.html#relationships) system
that explicitly models relationships, but it is unclear how that would be different than references.

We represent all of these by just directly referring to the object type, preserving the source type
in an annotation, when necessary.


## LinkML to Everything
Expand Down
11 changes: 11 additions & 0 deletions docs/meta/references.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# References

## Documentation

- [hdmf](https://hdmf.readthedocs.io/en/stable/)
- [hdmf-common-schema](https://hdmf-common-schema.readthedocs.io/en/stable/)
- [pynwb](https://pynwb.readthedocs.io/en/latest/)

```{todo}
Add the bibtex refs to NWB papers :)
```
3 changes: 2 additions & 1 deletion docs/meta/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ NWB schema translation
- handle compound `dtype` like in ophys.PlaneSegmentation.pixel_mask
- handle compound `dtype` like in TimeSeriesReferenceVectorData
- Create a validator that checks if all the lists in a compound dtype dataset are same length
- [ ] Move making `target` optional in vectorIndex from pydantic generator to linkml generators!

Cleanup
- [ ] Update pydantic generator
Expand All @@ -22,7 +23,7 @@ Cleanup

- [ ] Make a minimal pydanticgen-only package to slim linkml deps?
- [ ] Disambiguate "maps" terminology - split out simple maps from the eg. dataset mapping classes
- [ ] Remove unnecessary imports
- [x] Remove unnecessary imports
- dask
- nptyping
- [ ] Adapt the split generation to the new split generator style
Expand Down
Loading
Loading