neuralmonkey icon indicating copy to clipboard operation
neuralmonkey copied to clipboard

Series IDs get somehow lowercased during configuration loading

Open jlibovicky opened this issue 8 years ago • 8 comments
trafficstars

I found no place in our code that may cause it. I guess it is the INI parser which pre-processes the field names.

jlibovicky avatar Aug 21 '17 16:08 jlibovicky

Do you mean that s_UP=... is interpreted as s_up=...?

tomasmcz avatar Aug 28 '17 14:08 tomasmcz

From Python's ConfigParser documentation:

As we can see above, the API is pretty straightforward. The only bit of magic involves the DEFAULT section which provides default values for all other sections [1]. Note also that keys in sections are case-insensitive and stored in lowercase [1].

jindrahelcl avatar Aug 28 '17 15:08 jindrahelcl

https://docs.python.org/3/library/configparser.html#quick-start

jindrahelcl avatar Aug 28 '17 15:08 jindrahelcl

I suggest to document this and leave it as it is.

jindrahelcl avatar Aug 28 '17 15:08 jindrahelcl

If we decide we want to allow case-sensitive keys, there is an option: https://docs.python.org/3/library/configparser.html#configparser.optionxform

jindrahelcl avatar Aug 28 '17 15:08 jindrahelcl

Or we could abandon (or at least deprecate) the **kwargs hack in load_dataset_from_files and use something like series_in=[("UpperCase", "path/to/file"), ...] and series_out=[("UpperCaseOut", "path/to/file"), ...].

We could also extend the ini syntax to enable linebreaks inside brackets, so this can be written in an elegant way.

tomasmcz avatar Aug 28 '17 15:08 tomasmcz

If you are really willing to extend the syntax in this way, I would prefer getting rid the **kwargs like this, it would come in handy in other situations like listing postprocessors. Otherwise, I would stick to the current state, the in-line lists would only make the config clumsy.

jlibovicky avatar Aug 28 '17 17:08 jlibovicky

Solution to this issue: Fix error messages to contain the set of defined series ids:

Error: unknown series ID: "SoUrCe". Possible IDs are: ["source", "target"]

jindrahelcl avatar Mar 20 '18 15:03 jindrahelcl