datajoint-python icon indicating copy to clipboard operation
datajoint-python copied to clipboard

prohibit custom fields in `dj.config`

Open dimitri-yatsenko opened this issue 6 years ago • 4 comments

Currently, dj.config allows users to add new fields in dj.config. This works fine but sometimes leads to errors when a standard field is misspelled. I propose to designate a single field, dj.config['user'] or dj.config['custom'] to keep all custom user fields and prohibit the user from adding any non-sanctioned keys to dj.config.

dimitri-yatsenko avatar Feb 05 '19 19:02 dimitri-yatsenko

To clarify, you mean a single field that can contain multiple other fields, right, like dj.config['user']['parameter_1'] and dj.config['user']['parameter_2']?

austin-hilberg avatar Feb 08 '19 21:02 austin-hilberg

yes

dimitri-yatsenko avatar Feb 08 '19 21:02 dimitri-yatsenko

How much of a pain point will introducing such a constraint be to users with existing custom fields in dj.config?

austin-hilberg avatar Feb 11 '19 20:02 austin-hilberg

some. The error message will state the following

Since version 0.12.1 datajoint.config requires that any custom 
configuration parameters must be placed under datajoint.config['user'].

dimitri-yatsenko avatar Feb 12 '19 21:02 dimitri-yatsenko