From 2dbfcf1645e3169166839ca995d5fcbcb7f7a5d3 Mon Sep 17 00:00:00 2001 From: Valentin Boettcher Date: Mon, 13 May 2019 11:38:39 +0200 Subject: [PATCH] get symbols recursively --- SecondaryValue/SecondaryValue.py | 10 ++++++---- setup.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/SecondaryValue/SecondaryValue.py b/SecondaryValue/SecondaryValue.py index d45e497..82bc926 100644 --- a/SecondaryValue/SecondaryValue.py +++ b/SecondaryValue/SecondaryValue.py @@ -147,7 +147,7 @@ class SecondaryValue: for var in args: if var not in self._derivatives: - self._derivatives[var] = sympy.diff(self._parsed, var) + self._derivatives[var] = diff(self._parsed, var) return {var: self._derivatives[var] for var in args} @@ -167,8 +167,10 @@ class SecondaryValue: def get_symbols(self): """ - :returns: The symbols that can be substituted. - :rtype: set + :returns: The symbols that can be substituted (recursively). + :rtype: dict """ - return self._symbols + return {symbol: self._deps[symbol].get_symbols() \ + if symbol in self._deps else {} \ + for symbol in self._symbols} diff --git a/setup.py b/setup.py index 0f27e15..27638dd 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ def readme(): return f.read() setup(name='SecondaryValue', - version='0.0.9', + version='0.1.0', description='A helper to calculate the gaussian error propagation.', long_description=readme(), long_description_content_type='text/markdown',