You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me begin with saying that global variables are evil and nobody should be using them.
For things like #4372 it would be really useful to have a place where to make global config changes.
Matplotlib does it and ArviZ too.
Aesara also has a quite powerful config implementation that I refactored quite a bit a few months back.
Or maybe we don't even need/want a place for global configuration settings?
Anyways it would be great to discuss and figure out what we want!
Update 2022-03-30 + ToDo
We have a general consensus that we want to do this. (I'm updating the title+labels in a second.)
Sounds like we are in favor of global config settings.
So how should we implement it?
Option 1: rcParams
➕ Users know it from matplotlib and arviz
➕ Can change options with context managers (I didn't know that - thanks @OriolAbril !)
➖ Mix of two different config schemes (Aesara vs. PyMC3)
Option 2: aesara.configparser
➕ Users know it from theano/aesara
➕ Can change options with context managers
➕ Can work with CLI params/environment variables
➖ Mix of two different config schemes (Aesara+PyMC3 vs. ArviZ)
Feel free to edit this comment to add/edit the ➕/➖ items.
I'd go with whatever is easier to add and maintain. ArviZ/matplotlib version has no dependencies because it has the reader and rcparams object as part of the codebase.
Also not sure what you mean by always global in the matplotlib/arviz one, both can be configured temporarly with context managers.
After looking at the size of the ArviZ rcParams implementation 😮 I'd actually recommend the Aesara configparser.
It comes down to copyediting the following:
changed the title [-][Discussion] Introduce `rcParams` for global config settings[/-][+]Introduce `pm.config` or `rcParams` for global & local config settings[/+]on Mar 30, 2022
Activity
ricardoV94 commentedon Apr 23, 2021
What kind of things would go in here?
michaelosthege commentedon Apr 23, 2021
return_inferencedata
default valueSpecifyShape
when full-lengthshape
is passed on/offcompute_convergence_checks
ordiscard_tuned_samples
maybe?OriolAbril commentedon Apr 23, 2021
init
in sample, and anything else where we have a "you can't trust the default to stay the same"keep_size
? for people who wants to live in the past and get flattened samples in sample_posterior_predictive after Set keep_size=True in v4 #4647twiecki commentedon Apr 24, 2021
I like it, I often use a default-dict for the
sample()
kwargs.michaelosthege commentedon Apr 24, 2021
Sounds like we are in favor of global config settings.
So how should we implement it?
Option 1:
rcParams
➕ Users know it from
matplotlib
andarviz
➕ Can change options with context managers (I didn't know that - thanks @OriolAbril !)
➖ Mix of two different config schemes (Aesara vs. PyMC3)
Option 2:
aesara.configparser
➕ Users know it from
theano/aesara
➕ Can change options with context managers
➕ Can work with CLI params/environment variables
➖ Mix of two different config schemes (Aesara+PyMC3 vs. ArviZ)
Feel free to edit this comment to add/edit the ➕/➖ items.
OriolAbril commentedon Apr 24, 2021
I'd go with whatever is easier to add and maintain. ArviZ/matplotlib version has no dependencies because it has the reader and rcparams object as part of the codebase.
Also not sure what you mean by always global in the matplotlib/arviz one, both can be configured temporarly with context managers.
michaelosthege commentedon Apr 25, 2021
After looking at the size of the ArviZ
rcParams
implementation 😮 I'd actually recommend the Aesara configparser.It comes down to copyediting the following:
_create_default_config
function inpymc3/configdefaults.py
config
instance inpymc3/configdefaults.py
and importing it to the package level:pm.config
pm.config.add()
as seen in aesara/configdefaults.pyferrine commentedon Mar 30, 2022
I like the idea. There should also be a way to make temporary changes in a context manager like done in matplotlib
[-][Discussion] Introduce `rcParams` for global config settings[/-][+]Introduce `pm.config` or `rcParams` for global & local config settings[/+]