-
Notifications
You must be signed in to change notification settings - Fork 21
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
[DEFECT] Code crashes when MACRS and lifetime are equal #53
Comments
@mgarrouste I can't replicate your issue by only changing the lifetime and depreciation schedule to the same number. Can you post a simple reproducible example/input file? Thanks EDIT: Also please include the full stack trace for the error that was thrown. |
Here is my heron input, I changed the lifetime of the HTSE component from 30 years to 20 and now it crashes. The inner output file is attached as well as the console output.
|
I've pinpointed where the error in the code is coming from. In def amortize(scheme, plan, startValue, componentLife):
"""
return the amortization plan
@ In, scheme, str, 'macrs' or 'custom'
@ In, plan, list or array like, list of provided MACRS values
@ In, startValue, float, the given initial Capex value
@ In, componentLife, int, the life of component
@ Out, alpha, numpy.array, array of alpha values for given scheme
"""
alpha = np.zeros(componentLife + 1, dtype=float)
lscheme = scheme.lower()
if lscheme == 'macrs':
ys = plan[0]
pcts = MACRS.get(ys, None)
if pcts is None:
raise IOError('Provided MACRS "{}" is not allowed.'.format(ys))
alpha[1:len(pcts)+1] = pcts * startValue
elif lscheme == 'custom':
alpha[1:len(plan)+1] = np.asarray(plan)/100. * startValue
else:
raise NotImplementedError('Amortization scheme "{}" not yet implemented.'.format(scheme))
return alpha |
We can fix this easily by adding an additional Would it make sense to use a depreciation schedule of '20' when the lifetime of the component is '20'? |
I have a case where I am modelling an High Temperature Steam Electrolysis Process and the report about the costs assumes a 20 years project duration as well as a 20 years MACRS depreciation schedule |
@mgarrouste Does the HTSE have an assumed lifetime of 20 years too? Or just a project time of 20 years? |
@dylanjm @worseliz @wangcj05 @AaronEpiney @GabrielSoto-INL I experience the same issue. |
Defect Description
Describe the defect
What did you expect to see happen?
I expected the HERON model to run
What did you see instead?
An exception was thrown because 2 arrays were incompatible in size
Do you have a suggested fix for the development team?
Describe how to Reproduce
Steps to reproduce the behavior:
Screenshots and Input Files
Please attach the input file(s) that generate this error. The simpler the input, the faster we can find the issue.
Platform (please complete the following information):
For Change Control Board: Issue Review
This review should occur before any development is performed as a response to this issue.
For Change Control Board: Issue Closure
This review should occur when the issue is imminently going to be closed.
The text was updated successfully, but these errors were encountered: