pace-neutrons / Horace

Horace is a suite of programs for the visualization and analysis of large datasets from time-of-flight neutron inelastic scattering spectrometers.
https://pace-neutrons.github.io/Horace/stable/
GNU General Public License v3.0
8 stars 5 forks source link

Serializable constructor utility set_positional_and_key_val_arguments has ambiguity #1061

Open tgperring opened 1 year ago

tgperring commented 1 year ago

Positional arguments that are strings are checked differently depending on the class of the corresponding property being a string or not. This should be changed because it makes the parsing dependent on the state of the object and assumptions about the interpretation of the classes of object properties.

This was implemented for a reason, but reveals a fundamental ambiguity about being able to tell if a positional argument is a property name (keyword) or a property value (positional argument). If keywords are required to start with '-' then this would disappear: no property name is permitted to start with '-'. This may contradict current PACE conventions about the form of function arguments.

cmarooney-stfc commented 1 year ago

@tgperring Toby could you assign a priority please