AI-multimodal / aimmdb

BSD 3-Clause "New" or "Revised" License
0 stars 10 forks source link

Re-implement validation classes #70

Open dylanmcreynolds opened 7 months ago

dylanmcreynolds commented 7 months ago

In the original AIMMDB, validation callables were added so that we can test the validity of different types of XAS files on import. They feel a lot like the currently supported tiled versions of validation, but are configured differently. When we migrated the database from old to modern tiled, we skipped the step of reimplementing them. The code for them are still in the code base, but they are not called anywhere.

Meanwhile, the validation written for aimmdb mostly made it to tiled. So, let's do what we need to do to refactor what was in the old aimmdb and make it avaiable in the new tiled-based aimmdb. This could be as simple as modifying the config file and making sure that the python files are available in a place where tiled picks them up. We might also think about sending a PR to tiled with an example config for validators.

For some context, tiled has the concept of specs which define the specification of a type of data, and a validator can be configured for a spec.

danielballan commented 7 months ago

Welcome @MonChou1!

The tiled unit tests may be a useful reference for how validators work currently:

https://github.com/bluesky/tiled/blob/main/tiled/_tests/test_validation.py