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

update spatial data schema #655

Merged
merged 13 commits into from
Dec 2, 2021

Conversation

CagtayFabry
Copy link
Member

@CagtayFabry CagtayFabry commented Nov 22, 2021

Changes

  • update core/geometry/spatial_data schema to support >2 dimensional arrays as xarray.DataArray
  • add wx_shape validation support for core/data_array
  • create manifest version 0.1.1
  • update manifest script

Related Issues

Closes # (add issue numbers)

Checks

  • updated CHANGELOG.rst
  • updated tests
  • updated doc/
  • update manifest file

@github-actions
Copy link

github-actions bot commented Nov 22, 2021

Unit Test Results

       1 files  ±0         1 suites  ±0   2m 4s ⏱️ +31s
1 948 tests +4  1 948 ✔️ +4  0 💤 ±0  0 ±0 

Results for commit 61c3e60. ± Comparison against base commit 8a79f5a.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Nov 23, 2021

Codecov Report

Merging #655 (61c3e60) into master (8a79f5a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #655   +/-   ##
=======================================
  Coverage   96.08%   96.08%           
=======================================
  Files          91       91           
  Lines        5895     5906   +11     
=======================================
+ Hits         5664     5675   +11     
  Misses        231      231           
Impacted Files Coverage Δ
weldx/asdf/util.py 90.13% <ø> (ø)
weldx/asdf/constants.py 100.00% <100.00%> (ø)
weldx/tags/core/data_array.py 100.00% <100.00%> (ø)
weldx/tags/core/geometry/spatial_data.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a79f5a...61c3e60. Read the comment docs.

@CagtayFabry CagtayFabry added ASDF everything ASDF related (python + schemas) validation custom ASDF validators labels Nov 24, 2021
@CagtayFabry CagtayFabry marked this pull request as ready for review December 2, 2021 08:21
@CagtayFabry CagtayFabry requested a review from vhirtham December 2, 2021 08:21
@CagtayFabry CagtayFabry self-assigned this Dec 2, 2021
Copy link
Collaborator

@vhirtham vhirtham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I am asking myself now is how the standard version and the schema versions are tied together:

If I modify another schema from version 0.1.0 to 0.1.1, will the standard still remain at 0.1.1 or does it bump to 0.1.2 since it is different from the previous 0.1.1? Or does the schema version automatically raise from 0.1.0 to 0.1.2 skipping 0.1.1. I guess the latter case makes more sense and the increments of the standard version are always tied to a new standard release (independent from a weldx release). So all schemas that are modified during a standard release have the same version number as the standard regardless of their previous version number.

Comment on lines +63 to +71
oneOf:
- tag: "tag:stsci.edu:asdf/core/ndarray-1.*"
properties:
datatype:
type: string
enum: [float32, float64]
wx_shape: [(~), 3]
- tag: "asdf://weldx.bam.de/weldx/tags/core/data_array-0.1.*"
wx_shape: [..., 3]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing this gets me thinking (also in the context of the GerericSeries) that the wx_shape validator should probably be able to deal with dimension names when used in conjunction with a data_array schema. For example, instead of [..., 3] we could write [..., c=3]. The latter case would express "any number of dimensions with arbitrary shape, but c must have shape (3,)" I think this would simplify things a bit since we do not need to define a coordinate order to fulfill the requirement. Maybe we should give this a different name (wx_coordinate_shape?) to avoid confusions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, in general I think it would be a good addition to have a powerful validator for xarray structures

the overall structure and implementation probably needs some planning

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I create a new issue as reminder?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that never hurts 😉

weldx/tags/core/data_array.py Show resolved Hide resolved
@CagtayFabry
Copy link
Member Author

Something I am asking myself now is how the standard version and the schema versions are tied together:

If I modify another schema from version 0.1.0 to 0.1.1, will the standard still remain at 0.1.1 or does it bump to 0.1.2 since it is different from the previous 0.1.1? Or does the schema version automatically raise from 0.1.0 to 0.1.2 skipping 0.1.1. I guess the latter case makes more sense and the increments of the standard version are always tied to a new standard release (independent from a weldx release). So all schemas that are modified during a standard release have the same version number as the standard regardless of their previous version number.

My idea for now was the following:

  • I only consider a standard version as released when it has been tagged/published to pypi/conda
  • right now I consider the standard version 0.1.1 as in development, meaning it only exists here on master and can change/break until the release
  • once released, no changes to the standard (or old schemas) are allowed

So right now we can gather all the work we do on schemas under the 0.1.1 version (or rename to 0.2.0 if we make big changes) here on master.
We just should rely on this to be stable until the release.

@vhirtham
Copy link
Collaborator

vhirtham commented Dec 2, 2021

Something I am asking myself now is how the standard version and the schema versions are tied together:
If I modify another schema from version 0.1.0 to 0.1.1, will the standard still remain at 0.1.1 or does it bump to 0.1.2 since it is different from the previous 0.1.1? Or does the schema version automatically raise from 0.1.0 to 0.1.2 skipping 0.1.1. I guess the latter case makes more sense and the increments of the standard version are always tied to a new standard release (independent from a weldx release). So all schemas that are modified during a standard release have the same version number as the standard regardless of their previous version number.

My idea for now was the following:

  • I only consider a standard version as released when it has been tagged/published to pypi/conda
  • right now I consider the standard version 0.1.1 as in development, meaning it only exists here on master and can change/break until the release
  • once released, no changes to the standard (or old schemas) are allowed

So right now we can gather all the work we do on schemas under the 0.1.1 version (or rename to 0.2.0 if we make big changes) here on master. We just should rely on this to be stable until the release.

So in this case, schema version numbers are not coupled to the standard version? Means, if the standard changes from 0.1.5 to 0.1.6 we can still have schemas that increase from 0.1.0 to 0.1.1?

@CagtayFabry
Copy link
Member Author

Something I am asking myself now is how the standard version and the schema versions are tied together:
If I modify another schema from version 0.1.0 to 0.1.1, will the standard still remain at 0.1.1 or does it bump to 0.1.2 since it is different from the previous 0.1.1? Or does the schema version automatically raise from 0.1.0 to 0.1.2 skipping 0.1.1. I guess the latter case makes more sense and the increments of the standard version are always tied to a new standard release (independent from a weldx release). So all schemas that are modified during a standard release have the same version number as the standard regardless of their previous version number.

My idea for now was the following:

  • I only consider a standard version as released when it has been tagged/published to pypi/conda
  • right now I consider the standard version 0.1.1 as in development, meaning it only exists here on master and can change/break until the release
  • once released, no changes to the standard (or old schemas) are allowed

So right now we can gather all the work we do on schemas under the 0.1.1 version (or rename to 0.2.0 if we make big changes) here on master. We just should rely on this to be stable until the release.

So in this case, schema version numbers are not coupled to the standard version? Means, if the standard changes from 0.1.5 to 0.1.6 we can still have schemas that increase from 0.1.0 to 0.1.1?

yes those are independent (and I would prefer to keep the changes in schema versions also following the semantic versioning for themselfes)

The coupling to the 'standard' version is only defined by the listing in the manifest file

@CagtayFabry CagtayFabry merged commit 35fcf33 into BAMWelDX:master Dec 2, 2021
@CagtayFabry CagtayFabry deleted the update_spatial_data_schema branch December 2, 2021 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASDF everything ASDF related (python + schemas) validation custom ASDF validators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants