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

Validate multiple instances #986

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

jesper-friis
Copy link
Collaborator

@jesper-friis jesper-friis commented Oct 26, 2024

Description

Update dlite-validate to validate sources with multiple instances, without having to provide the --id option.

This PR build on top of PR #985.

Update: Added new Python interface to the jstore implemented in C. Right now this increases the code base, but this change makes it possible to e.g. reduce utils.instance_from_dict() and Instance.asdict() to a few lines of code. An added benefit would be consistency with JSON parsing (since the json parser in C is used under the hood).

Suggests to take the code removal/replacement in a separate PR to have little more control over changes.

Type of change

  • Bug fix & code cleanup
  • New feature
  • Documentation update
  • Test update

Checklist for the reviewer

This checklist should be used as a help for the reviewer.

  • Is the change limited to one issue?
  • Does this PR close the issue?
  • Is the code easy to read and understand?
  • Do all new feature have an accompanying new test?
  • Has the documentation been updated as necessary?

@jesper-friis jesper-friis changed the base branch from master to fix-json-iterate October 26, 2024 16:32
Base automatically changed from fix-json-iterate to master October 29, 2024 08:33
@jesper-friis jesper-friis requested review from francescalb and removed request for francescalb October 29, 2024 13:41
src/dlite-json.c Outdated Show resolved Hide resolved
Comment on lines 38 to 55
d1 = {
"uuid": "d6a1c1db-44b6-5b87-b815-83f1127395b6",
"meta": "http://onto-ns.com/meta/ex/0.2/Test",
"dimensions": {"n": 3},
"properties": {
"a": "hello",
"b": [1.1, 2.2, 3.3],
},
}
d2 = {
"uuid": "d6a1c1db-44b6-5b87-b815-83f1127395b6",
"meta": "http://onto-ns.com/meta/ex/0.2/Test",
"dimensions": {"n": 3},
"properties": {
"a": "hello",
"b": [1.1, 2.2, 3.3],
},
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the difference between these two?

Copy link
Collaborator Author

@jesper-friis jesper-friis Nov 4, 2024

Choose a reason for hiding this comment

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

Good observation. You are right, for data instances there are no difference between the old and soft7 representations. I added a comment about this to the test

jesper-friis and others added 3 commits November 4, 2024 13:58
Co-authored-by: Francesca L. Bleken <48128015+francescalb@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants