-
Notifications
You must be signed in to change notification settings - Fork 35
Remove first and last keyword arguments #578
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think one if/then regarding before/after should not have been deleted. See comment...
Codecov Report
@@ Coverage Diff @@
## master #578 +/- ##
==========================================
- Coverage 77.46% 77.43% -0.04%
==========================================
Files 39 39
Lines 2574 2566 -8
==========================================
- Hits 1994 1987 -7
+ Misses 580 579 -1
Continue to review full report at Codecov.
|
@rjplevin I removed the use of @class mutable ComponentDef <: NamedObj begin
comp_id::Union{Nothing, ComponentId} # allow anonynous top-level (composite)
ComponentDefs (must be referenced by a ModelDef)
comp_path::Union{Nothing, ComponentPath}
dim_dict::OrderedDict{Symbol, Union{Nothing, Dimension}}
namespace::OrderedDict{Symbol, Any}
first::Union{Nothing, Int}
last::Union{Nothing, Int}
is_uniform::Bool
...
end |
Agreed, no need to leave artifacts behind. |
@rjplevin It turns out that deleting the first_period(obj::AbstractComponentDef) = obj.first
first_period(obj::AbstractComponentInstance) = obj.first
first_period(root::AbstractCompositeComponentDef, comp::AbstractComponentDef) = @or(first_period(comp), first_period(root)) These methods get used all throughout the code when setting parameters, making connections, and allocating timestep arrays (even though for now the first period is always just the first year of the time index, since the first/last functionality was disabled). I would have to delete and work around all the calls to Thoughts? |
I’m out running errands today, so slow in responding.
I think leaving it is reasonable for now.
Cheers,
Rich
… On Oct 16, 2019, at 12:06 PM, Cora Kingdon ***@***.***> wrote:
@rjplevin It turns out that deleting the first and last fields from those three classes is a bit more involved, since there are also these first_period and last_period methods for each type:
first_period(obj::AbstractComponentDef) = obj.first
first_period(obj::AbstractComponentInstance) = obj.first
first_period(root::AbstractCompositeComponentDef, comp::AbstractComponentDef) = @or(first_period(comp), first_period(root))
These methods get used all throughout the code when setting parameters, making connections, and allocating timestep arrays (even though for now the first period is always just the first year of the time index, since the first/last functionality was disabled). I would have to delete and work around all the calls to first_period in these places, but I'm wondering if it would be better to leave this untouched for v1.0.0, and then deal with them later when we might re-implement the first/last capabilities in a different way, as we were discussing at the end of this issue: #422
Thoughts?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
#567