Skip to content

Support JSON dictionary along JSON files as input to the ArgoValidator#12

Merged
matcor451 merged 5 commits intomainfrom
allow-dict-input
Nov 16, 2025
Merged

Support JSON dictionary along JSON files as input to the ArgoValidator#12
matcor451 merged 5 commits intomainfrom
allow-dict-input

Conversation

@gmaze
Copy link
Member

@gmaze gmaze commented Oct 29, 2025

Hi,
It would be very nice for cross-tools analysis if the ArgoValidator().validate() method could take an dictionary object, not necessarily a json file.
I propose here some update to the method to support this.

The use case would typically be when some sensor metadata will be loaded from a manufacturer API or any sensor metadata files with argopy to validate such data.

I also modified the init to be able to import the validator directly, such a nice feature needs the front row ;-)

from argopy import OEMSensorMetaData
obj = OEMSensorMetaData().from_rbr(208380)

from argo_metadata_validator import ArgoValidator
ArgoValidator().validate(oem.to_dict())

PS:
What I have in mind here, is to be able to use argo_metadata_validator in argopy for internal format validation. Cf, ongoing work on sensors at: euroargodev/argopy#532.

And since you support also float and platform schema, this should be used elsewhere in the future.

@gmaze gmaze marked this pull request as draft October 29, 2025 16:18
@gmaze gmaze marked this pull request as ready for review October 29, 2025 16:32
@gmaze gmaze requested review from kamwal and matcor451 October 29, 2025 16:35
@gmaze gmaze added the enhancement New feature or request label Oct 29, 2025
@matcor451
Copy link
Collaborator

Hi @gmaze, thanks for this. It's definitely a good idea to add in. I'll find some time in the next week to have a proper look through this and get it merged in

@matcor451 matcor451 merged commit 6edefe0 into main Nov 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants