-
Notifications
You must be signed in to change notification settings - Fork 10
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 single-pass weld schema #578
Conversation
Codecov Report
@@ Coverage Diff @@
## master #578 +/- ##
=======================================
Coverage 94.83% 94.83%
=======================================
Files 93 93
Lines 5745 5745
=======================================
Hits 5448 5448
Misses 297 297
Continue to review full report at Codecov.
|
@CagtayFabry Do you still have the script to update the example in the schema? We should probably add these changes to the |
that was all regex 🚀 I was wondering why the asdf schema tests pass here but it makes sense because the schema tests don't know about any custom schema file to validate against etc. and we should wait for this with |
okay, I will use this then
Was wondering about this too until I realized that custom schema examples are not validated 😄 |
I think the examples do get validated ( the second dot of the test output here) but it will only validate the tagged objects in the tree and not the overall schema layout (because the test doesn't know we want to use the file as a |
That's what I meant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 ⭐
Just a reminder, If we change a schema, shouldn't we begin to increase the version number of the schema? Now files created with the old version will just fail to validate against the same version, which is kind of confusing. Just a quick question, is there an ASDF way of upgrading trees according to a schema (like a Converter)? |
yes, if we make schemas we should change the schema name (=increase version numbers) I only consider the released weldx version as 'stable' in the sense that they should work, I expect changes on master between weldx to break things rather often (until the release) For the file-schema here, if you want to load an from pathlib import Path
from weldx import WeldxFile
from weldx.asdf.util import get_schema_path
file_schema = get_schema_path("single_pass_weld-1.0.0.schema.yaml") # legacy schema to validate
compat_file = Path("old.weldx") # path to version 0.4 file
new_file = Path("new.weldx") # path to save new 0.5 file
with WeldxFile(
compat_file,
mode="r",
custom_schema=file_schema,
sync=False,
asdffile_kwargs={"copy_arrays": True},
) as file_04:
file_04["welding_current"] = file_04["welding_current"].data # need to change this for new schema
file_04["welding_voltage"] = file_04["welding_voltage"].data # need to change this for new schema
file_05 = WeldxFile(tree=file_04, mode="rw", custom_schema="single_pass_weld-0.1.0") # validate against new schema
if new_file.exists():
new_file.unlink()
file_05.write_to(new_file) if you want to convert a file that was contructed with the current master, the following should work:
let me know if it works |
Changes
Update the single-pass weld schema to use a
TimeSeries
instead of aSignal
forwelding_current
andwelding_voltage
Related Issues
See #559
Checks
updated testsupdate example/tutorial notebooksupdate manifest file