Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oat_dashboard - if parameter is not a uniform distribution, range function returns always nan #10

Open
ntropy-esa opened this issue Mar 3, 2021 · 0 comments

Comments

@ntropy-esa
Copy link

Hello,
We continue our work with lca_algebraic and found a few things to fix. Not worth making a pull request for that, though.

1/ Just noticed a typo in the current master branch

In file: params.py
Line: 42
"min": data.get("mininum"),
Should read: minimum

2/ When using loadParams() for the type 7 - Discrete uniform uncertainty

I have defined a boolean (not an enumeration) but it gets detected as an enumeration

File: params.py
Line: 476
if data.get('scale') is not None :
# Enum param : group them by common prefix

In my case, even though it's not an enum param, I don't have a None as scale, but a nan
print(data.get('scale')) > returns nan

Just think we need to change that if statement, for me this works:

             if not np.isnan(data.get('scale')) and data.get('scale') is not None:

3/ And finally, when using the function oat_dashboard in stats.py with a parameter having a normal distribution, the method .range(n) returns always nan, because normal params don't have a min and max. But it works when I use a param with uniform distribution.

File: stats.py
Line: 118

# Compute range of values for given param
params[varying_param.name] = varying_param.range(n)

File: params.py
Line: 160

def range(self, n):
    '''Used for parametric analysis'''
    step = (self.max - self.min) / (n - 1)
    return list(i * step + self.min for i in range(0, n))

I think this function should distinguish between the distribution types, and if it does not have a min/max set, we can find a way of defining of min/max: e.g. for a normal distribution, min/max could be mean -/+ 2*standard deviation ? Similar for other distribution types? What do you think?

Worth noting: we work with parameters that have been defined in the activity-browser, and then imported in the notebook with the new function loadParams()

/Elias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant