Closed lpatiny closed 1 year ago
Is this still a problem?
imho they are similar enough, but where the binary format explicitly knows the type, the text format may only knows smth is a number, string, or StringObject.
These are the current output types for each format:
export interface MPR {
name: string /** a string in the first line */;
data: { header: ModuleHeader; variables: ParseData };
settings: { header: ModuleHeader; variables: ParseSettings };
log?: { header: ModuleHeader; variables: ParseLogs };
loop?: { header: ModuleHeader; variables: ParseLoop };
}
export interface MPT {
name?: string;
nbOfHeaderLines?: number;
/* settings module */
settings?: LogAndSettings['settings'];
/* log module */
log?: LogAndSettings['log'];
/* data module, may not be there */
data?: { variables: Record<string, MeasurementVariable> };
}
It is probably possible to make still more adjustments, and maybe refactor it once it starts doing something useful.
Both MPT and MPR should return a very similar structure and this seems not to be the case currently.
Please also take care that the variables are typed and of type
MeasurementVariable
from cheminfo-types.We are moving more and more types to cheminfo-types so that we can be sure of the compatibility of objects between different projects.