Conversation
mtinning
requested changes
Mar 24, 2020
Member
mtinning
left a comment
There was a problem hiding this comment.
Couple of suggestions - you might find the testing problem disappears
| raise ImportError("The scipy module is not installed and therefore the 'scipy.{}'" | ||
| " generator cannot be created".format(distribution)) from ex | ||
| if not hasattr(scipy_stats_module, distribution): | ||
| raise KeyError("'{}' distribution not found in scipy.stats module") |
| :param kwargs: Arguments to creation of statistical function | ||
| """ | ||
| try: | ||
| scipy_stats_module = import_module('scipy.stats') |
Member
There was a problem hiding this comment.
Caution advised when using importlib functions directly. I would rewrite this to:
try:
import scipy.stats
except ImportError as ex:
....
Member
Author
There was a problem hiding this comment.
I changed it as suggested, although that did lead to a strange AttributeError which had to be fixed by importing in conftest.py.
However, the build is still failing because scipy is not in the environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allows use of any class from
scipy.statsas a method for a generator by prefixing the method withscipy.. For example:{ "generators": { "Gen1": { "method": "scipy.norm", "loc": 12.0, "scale": 2.5, "random_state": 14 } } }The random state creates a
numpy.random.RandomStatethat persists through the life of the generator allowing repeatable generation of values.Scipy (and numpy) has not been added as an install requirement but the user is thrown an error if it is not installed when using a scipy generator method.
Closes #112