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
This is caused because Python evaluates default argument values once when the method is defined, rather than at call time, so these are setting the value when the program started up NOT the value after you change it.
In [7]: from hgvs.normalizer import Normalizer
In [8]: Normalizer.__init__?
Signature:
Normalizer.__init__(
self,
hdp,
cross_boundaries=False,
shuffle_direction=3,
alt_aln_method='splign',
validate=True,
variantmapper=None,
)
So there are 2 fixes:
a) Make global_config read only (throwing an exception in setattr) saying that it is designed to run off ini files and is NOT modifiable
b) Go through and replace all default arguments set from global config with None, then in the constructor, check if is not None then set off global config (this will pull in the present value)
Describe the bug
I set a global_config setting like:
I then call assembly_mapper:
with a print statement, I can see that this config value is set correctly here in assembly mapper:

But when the Normalizer class is initialized, it is pulling whatever value is in the _data/defaults.ini file (and I'm not sure why)
A print here shows this is '3' instead of the expected 5 value that was set:

To Reproduce
Described above
Expected behavior
For this configuration value to be set globally
The text was updated successfully, but these errors were encountered: