Skip to content

Conversation

baggepinnen
Copy link
Contributor

This PR adds [description = "sting"] to a number of variables and parameters in the Blocks and Rotational modules. Other modules will come in separate PRs.

This serves two purposes

  1. Make models from model libraries easier to work with. Without a description, it's hard to know what a variable called k deep inside a model does, in particular if the model comes from a library.
  2. Illustrate best practices. People are likely to look to MTKstdlib to learn how to build component libraries, and I hope to establish adding variable descriptions as a best practice people follow.

@codecov
Copy link

codecov bot commented Dec 22, 2022

Codecov Report

Merging #135 (4c7b3ef) into main (a821c7a) will increase coverage by 0.67%.
The diff coverage is 97.91%.

@@            Coverage Diff             @@
##             main     #135      +/-   ##
==========================================
+ Coverage   65.34%   66.01%   +0.67%     
==========================================
  Files          33       33              
  Lines        1434     1436       +2     
==========================================
+ Hits          937      948      +11     
+ Misses        497      488       -9     
Impacted Files Coverage Δ
src/Blocks/utils.jl 68.00% <85.71%> (+6.46%) ⬆️
src/Blocks/continuous.jl 98.20% <100.00%> (+0.03%) ⬆️
src/Blocks/math.jl 100.00% <100.00%> (+3.79%) ⬆️
src/Blocks/nonlinear.jl 100.00% <100.00%> (ø)
src/Blocks/sources.jl 92.45% <100.00%> (ø)
src/Mechanical/Rotational/components.jl 100.00% <100.00%> (+4.34%) ⬆️
src/Mechanical/Rotational/utils.jl 93.02% <100.00%> (+5.21%) ⬆️

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

@baggepinnen
Copy link
Contributor Author

baggepinnen commented Dec 22, 2022

JuliaFormatter does not appear to understand the @variables macro, when formatting the continuous.jl file, it tries to change the syntax

xd(t)=xd_start [
        description = "Derivative state of SecondOrder filter $name",
    ]

from short to long function definition:

function xd(t)
        xd_start
    end [
        description = "Derivative state of SecondOrder filter $name",
    ]

domluna/JuliaFormatter.jl#669

@YingboMa YingboMa merged commit fbccceb into SciML:main Jan 3, 2023
@baggepinnen baggepinnen deleted the descriptions branch January 3, 2023 15:33
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.

2 participants