datajoint / datajoint-python

Relational data pipelines for the science lab
https://datajoint.com/docs
GNU Lesser General Public License v2.1
168 stars 84 forks source link

prohibit custom fields in `dj.config` #561

Open dimitri-yatsenko opened 5 years ago

dimitri-yatsenko commented 5 years ago

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.

austin-hilberg commented 5 years ago

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']?

dimitri-yatsenko commented 5 years ago

yes

austin-hilberg commented 5 years ago

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

dimitri-yatsenko commented 5 years ago

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'].