VH-Lab / DID-matlab

Data Interface Database
Other
1 stars 1 forks source link

Consolidate functions for replacing path placeholder with path location #75

Open ehennestad opened 1 month ago

ehennestad commented 1 month ago

The following functions seem to have some overlap:

in did.document/readjsonfilelocation: https://github.com/VH-Lab/DID-matlab/blob/f4248688d49c68030ec2ebf68f4f92860969f281/code/%2Bdid/document.m#L728

in did.database/get_document_schema https://github.com/VH-Lab/DID-matlab/blob/f4248688d49c68030ec2ebf68f4f92860969f281/code/%2Bdid/database.m#L1051

did.common.utility. replace_didpath https://github.com/VH-Lab/DID-matlab/blob/f4248688d49c68030ec2ebf68f4f92860969f281/code/%2Bdid/%2Bcommon/%2Butility/replace_didpath.m#L1

Any other places?

Could consolidate this into a set of utility functions.

stevevanhooser commented 1 month ago

Yes, some overlap. readjsonfilelocation is more tolerant (one can say 'base' and it will find the 'base.json' file wherever it lives), whereas the get_document_schema expects (and we should insist on) a full path that may include a $PATH definition. We don't want get_document_schema to look around like readjsonfilelocation; we want it to find the precise schema specified. (Basically, cases b and c from readjsonfilelocation.)