megmcca / FitSNAP

Software for generating SNAP machine-learning interatomic potentials
GNU General Public License v2.0
0 stars 0 forks source link

Streamline configuration file (settings file) input/output #13

Open megmcca opened 12 months ago

megmcca commented 12 months ago

For library mode to run properly, configuration object should mirror the input_dict and/or configuration file nearly exactly (i.e. maybe change datatype, but not change value itself). Examples of failures: in fitsnap.in:

[XYZ]
abc = PQ
some_file = some.txt
some_int = 1
some_fraction = 0.4

EXPECTED at runtime:

> print(fitsnap.config.sections["XYZ"].abc)
> "PQ" 
> print(fitsnap.config.sections["XYZ"].some_file)
> "some.txt" 
> print(fitsnap.config.sections["XYZ"].some_int)
> 1
> print(fitsnap.config.sections["XYZ"].some_fraction)
> 0.4

but what actually happens:

> print(fitsnap.config.sections["XYZ"].abc)
> "pq" 
(lower case for some reason)

> print(fitsnap.config.sections["XYZ"].some_file)
> Error: variable "some_file" doesn't exist
(whut? this shouldn't happen at all!)
> print(fitsnap.config.sections["XYZ"].some_stupid_new_variable_for_filename)
> "some.txt"
(what happened?)

> print(fitsnap.config.sections["XYZ"].some_int)
> 1.0000000000001 
(was transformed somewhere and gained a numerical nugget)

> print(fitsnap.config.sections["XYZ"].some_fraction)
> 56 
(turned into an int as a raw count from fraction)

This is driving me completely insane!!!! Here are areas where it transforms the input into something unexpected:

  1. OUTFILE: almost all of these variables are deleted and/or transformed, probably the worst offender of them all
  2. GROUPS.group_table, training_size, testing_size: inputs are percents (floats), outputs are integers...
  3. .... more on the way as i find them