cheminfo / biologic-converter

MIT License
1 stars 2 forks source link

MPT / MPR and return values #7

Closed lpatiny closed 1 year ago

lpatiny commented 2 years ago

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.

targos commented 2 years ago

Is this still a problem?

ghost commented 2 years ago

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.