Conversation
|
The problem in the x86 test is that I specified it to be |
| include("simple.jl") | ||
| include("calendar.jl") | ||
| include("representative.jl") | ||
| include(joinpath("representative", "core_types.jl")) |
There was a problem hiding this comment.
I do not think joinpath should be used here. It seems unnecessary in this setting, "representative/core_types.jl" is both shorter and easier to understand.
There was a problem hiding this comment.
Fair enough. We switched to joinpath() a while ago. I guess the key reason from our side is to make it platform independent. Then again, we know that the tests are working with or without on both Linux and Windows.
| periods of a `TimeStructure`. The type of the iterator is dependent on the type of the | ||
| input `TimeStructure`, | ||
|
|
||
| When the `TimeStructure` is a `TimeStructure`, `repr_periods` returns a |
There was a problem hiding this comment.
I would try to rephrase this a bit as the first sentence is kind of a tautology. I would also skip a reference to the SinglePeriodReprWrapper since this is documentation for an exported function. Maybe something along the lines of "If the time structure does not have representative periods, it will return the provided time structure as an iterable structure".
There was a problem hiding this comment.
Regarding the first point: I push an update. I guess iterator for iterating is a bit too much.
I am a bit skeptical regarding the second point. I would anyhow suggest to export the internal docstrings as well to an internal library as we do in EMX.
| """ | ||
| When the `TimeStructure` is a [`RepresentativePeriods`](@ref), `repr_periods` returns the | ||
| iterator [`ReprPeriods`](@ref). | ||
| """ |
There was a problem hiding this comment.
As above, I am bit skeptical about referring to ReprPeriods which is an internal structure. Do we need a separate docstring for this version of repr_periods or should it be covered by one general docstring?
There was a problem hiding this comment.
We could include it for the general. The advantage of individual is that it is easy to extend the docstring. Regarding the other points, see above.
| _strat_per(sro::StratReprOpscenario) = sro.sp | ||
| _rper(sro::StratReprOpscenario) = sro.rp | ||
|
|
||
| mult_repr(sro::StratReprOpscenario) = sro.mult_rp |
There was a problem hiding this comment.
We could. It could be useful in general when we want to know the exact value within an representative period. In EMX, we however use the directly scaled value.
|
I like the restructuring proposed as a template for I agree with the suggested change for Do you think this should be merged as a separate PR and the other time structures as individual PRs? |
I think we can manage it as a single major restructuring. I can get started with it rather soonish and can be finished within the end of next week. The question is whether we merge #22 first, as it would simplify a potential rebase. Personally, I would also like to extend |
b7224f7 to
08ef004
Compare
|
I pushed a new update with also changing it to 92 column length in I am not fully satisfied yet, but it is a move in the correct direction. There are still a few things which I want to test out. |
|
I am not fully satisfied yet, but I think it is best to have separate PRs for the remaining parts. One important thing for me is to unify the type fields and potentially provide more functions there to access internal topics. I will create an Issue outlining the problems and think of an approach to the problems. |
So far, it was difficult to keep an overview over the individual functions for all types. This is a first take on restructuring the folders and the files. I focused on representative periods as these are middle functions.
The aim of the restructuring is:
TimeStructureand its constructors as well as the correspondingTimePeriod(this would be, e.g., the fileTwoLevel.jl) and the one which provides all internal types for iterating (this would be in the example the filestrat_periods.jl),repr_period,In addition, I ordered the method definitions for the individual functions so that they follow exactly the same structure and added docstrings.
Things to consider further:
OperationalPeriod <: TimePeriodaOperationalPeriod {P} <: TimePeriod where {P<:TimePeriod}As a side note: I guess it is probably easier to directly look at the files and not the changes. The exception is most likely
opscenarios.jl,stochastic.jl,and runtests.jl.