Skip to content

Commit

Permalink
change config api
Browse files Browse the repository at this point in the history
  • Loading branch information
philopon committed Jun 5, 2019
1 parent 97548ad commit ced4efc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions mordred/_base/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Calculator(object):
"_cache",
"_debug",
"_progress_bar",
"config",
"_config",
)

def __setstate__(self, dict):
Expand Down Expand Up @@ -94,7 +94,7 @@ def __reduce_ex__(self, version):
"_explicit_hydrogens": self._explicit_hydrogens,
"_kekulizes": self._kekulizes,
"_require_3D": self._require_3D,
"config": self.config,
"_config": self._config,
},
)

Expand All @@ -115,10 +115,14 @@ def __init__(self, descs=None, version=None, ignore_3D=False, config=None):
self._kekulizes = set()
self._require_3D = False
self._debug = False
self.config = config
self._config = config

self.register(descs, version=version, ignore_3D=ignore_3D)

def config(self, **configs):
r"Set global configuration."
self._config.update(configs)

@property
def descriptors(self):
r"""All descriptors.
Expand Down
2 changes: 1 addition & 1 deletion mordred/_base/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def from_calculator(cls, calc, mol, id):
calc._explicit_hydrogens,
calc._kekulizes,
id,
calc.config,
calc._config,
)

def get_coord(self, desc):
Expand Down

0 comments on commit ced4efc

Please sign in to comment.