Skip to content

Input changed to SampledData #165

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

Merged
merged 3 commits into from
May 4, 2023
Merged

Input changed to SampledData #165

merged 3 commits into from
May 4, 2023

Conversation

bradcarman
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented May 2, 2023

Codecov Report

Merging #165 (e62e80f) into main (4b9406d) will decrease coverage by 0.36%.
The diff coverage is 52.25%.

@@            Coverage Diff             @@
##             main     #165      +/-   ##
==========================================
- Coverage   59.59%   59.23%   -0.36%     
==========================================
  Files          41       42       +1     
  Lines        2027     2068      +41     
==========================================
+ Hits         1208     1225      +17     
- Misses        819      843      +24     
Impacted Files Coverage Δ
src/Hydraulic/IsothermalCompressible/components.jl 40.93% <44.23%> (-3.25%) ⬇️
src/Hydraulic/IsothermalCompressible/sources.jl 45.45% <45.45%> (ø)
src/Mechanical/Translational/sensors.jl 60.00% <50.00%> (+60.00%) ⬆️
src/Mechanical/Translational/sources.jl 60.00% <58.33%> (-13.34%) ⬇️
src/Blocks/sources.jl 80.00% <90.00%> (+0.61%) ⬆️
src/Mechanical/TranslationalPosition/sources.jl 83.33% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines 565 to 566
defaults = [output.u => get_sampled_data(0.0, buffer)]) #TODO: get initial value from buffer
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defaults = [output.u => get_sampled_data(0.0, buffer)]) #TODO: get initial value from buffer
end
defaults = [output.u => get_sampled_data(0.0, buffer)]) #TODO: get initial value from buffer
end
@deprecate Input SampledData

Since a release was made with the Input name, we should avoid breaking it completely.


This component is easy to use and is performative. However the data is locked to the `ODESystem` and can only be changed by building a new `ODESystem`. Therefore, running a batch of data would not be efficient. Below is an example of how to use the `TimeVaryingFunction` with `DataInterpolations` to build the function from discrete data.
The `ModelingToolkitStandardLibrary.Blocks.TimeVaryingFunction` component is easy to use and is performative. However the data is locked to the `ODESystem` and can only be changed by building a new `ODESystem`. Therefore, running a batch of data would not be efficient. Below is an example of how to use the `TimeVaryingFunction` with `DataInterpolations` to build the function from sampled discrete data.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

performative -> performant maybe?

@YingboMa YingboMa merged commit 4f90e60 into main May 4, 2023
@YingboMa YingboMa deleted the bgc/input_fix branch May 4, 2023 15:31
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

Successfully merging this pull request may close these issues.

3 participants