-
Notifications
You must be signed in to change notification settings - Fork 0
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
Run modelica-fmt v0.2-pr.1 #2
Conversation
On Fluid and Experimental.DHC only
@macintoshpie I am pinging you on this dummy PR to share some inline comments that I have on the Modelica code after running modelic-fmt on a few packages. |
@@ -13,8 +13,7 @@ model PartialParallel | |||
nPorts_aChiWat=1, | |||
nPorts_bHeaWat=1, | |||
nPorts_aHeaWat=1); | |||
parameter EnergyTransferStations.Types.ConnectionConfiguration conCon= | |||
EnergyTransferStations.Types.ConnectionConfiguration.Pump | |||
parameter EnergyTransferStations.Types.ConnectionConfiguration conCon=EnergyTransferStations.Types.ConnectionConfiguration.Pump |
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 format on the master was better.
Is it possible to enforce a line break to limit the line length at around 80 characters?
extent={{30.0,60.0},{30.0,110.0}}, | ||
textString="%name")}), | ||
Documentation(info="<html> | ||
annotation (defaultComponentName="y",Icon(coordinateSystem(preserveAspectRatio=true,extent={{-100.0,-100.0},{100.0,100.0}}),graphics={Polygon(lineColor={0,127,0},fillColor={255,255,255},fillPattern=FillPattern.Solid,points={{-100.0,100.0},{100.0,0.0},{-100.0,-100.0}})}),Diagram(coordinateSystem(preserveAspectRatio=true,extent={{-100.0,-100.0},{100.0,100.0}}),graphics={Polygon(lineColor={0,127,0},fillColor={255,255,255},fillPattern=FillPattern.Solid,points={{-100.0,50.0},{0.0,0.0},{-100.0,-50.0}}),Text(lineColor={0,0,127},extent={{30.0,60.0},{30.0,110.0}},textString="%name")}),Documentation(info="<html> |
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 annotation should be broken down with a constraint on line length.
parameter Boolean allowFlowReversal = true | ||
replaceable package Medium=Modelica.Media.Interfaces.PartialMedium | ||
"Medium in the component" | ||
annotation (choices(choice(redeclare package Medium=Buildings.Media.Air "Moist air"),choice(redeclare package Medium=Buildings.Media.Water "Water"),choice(redeclare package Medium=Buildings.Media.Antifreeze.PropyleneGlycolWater(property_T=293.15,X_a=0.40) "Propylene glycol water, 40% mass fraction"))); |
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.
res41( | ||
linearized=true), | ||
res42( | ||
linearized=true)); |
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.
Maybe we could think of a rule to allow one-line class modifications (per the definition of a class-modification in https://specification.modelica.org/maint/3.5/modelica-concrete-syntax.html) if they do not yield a line length > 80 characters, otherwise break the line before 80 characters and after the last character matching "," | "=" | "(" | " "
.
We could then apply this rule to declaration annotations (an annotation being syntactically defined by annotation class-modification
). That would avoid expanding all annotations, while keeping the line length manageable.
Thanks for the feedback Antoine! I will spend some time thinking about this and get back to you soon. |
@AntoineGautier I've created a (semi-hacky) implementation of the line break. It's not perfect, but it does break up lines 80+ characters. Please test the branch of this PR and let me know if this is any improvement: urbanopt/modelica-fmt#24 It breaks after |
Issue2264 generic cooling
created G36 package and updated trim/respond
- Use a signed variable for cap and assign -/+ abs(cap) to Q_flow. - Add simulation parameters to components. - Add icons to template classes. - Fix URI. - Add validation models.
Temporary branch testing modelica-fmt v0.2-pr.1 on
Fluid
andExperimental.DHC
packages only.Opening a draft PR to comment on the code.
Branch and PR shall be closed and deleted without merging when the test is done.