-
Notifications
You must be signed in to change notification settings - Fork 23
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
Updates for supplemental attributes #323
Conversation
old_uuid = get_uuid(component) | ||
new_uuid = make_uuid() | ||
if has_time_series(component) | ||
container = get_time_series_container(component) | ||
# There may be duplicates because of transform operations. | ||
changed_uuids = Set{Tuple{Base.UUID, String}}() | ||
for (key, ts_metadata) in container.data | ||
changed_uuid = (old_uuid, key.name) | ||
ts_uuid = get_time_series_uuid(ts_metadata) | ||
changed_uuid = (ts_uuid, key.name) |
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.
This is an existing bug that affects some use case in PowerSystems, like convert_component!
. Users would know if they experienced it. We could back-port the if necessary. Since no one has reported it, that is probably not needed.
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.
ok
The code used to allow changing a component UUID directly through the component. That is no longer allowed because the system keeps a separate dictionary of component UUIDs. So, the function call must now go through the system.
ccdcd63
to
fe73f47
Compare
fe73f47
to
b3fd7fa
Compare
@@ -851,6 +866,11 @@ end | |||
get_components_by_name(::Type{T}, data::SystemData, args...) where {T} = | |||
get_components_by_name(T, data.components, args...) | |||
|
|||
function get_components(data::SystemData, attribute::SupplementalAttribute) |
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.
Are we ok with letting the compiler figure out the eltype
of the resulting vector or should we add a type annotation?
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.
The eltype could be concrete or abstract depending on whether all components are the same type. The compiler should make the eltype the concrete type or first common supertype.
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.
Left some minor comments to consider
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #323 +/- ##
==========================================
- Coverage 78.93% 78.81% -0.13%
==========================================
Files 52 52
Lines 4121 4135 +14
==========================================
+ Hits 3253 3259 +6
- Misses 868 876 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This PR adds these items:
assign_new_uuid
. The function now has to go through the system because of the UUID dictionary that we are managing.