Skip to content
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

example flag style propagation + minor corrections #98

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

argonaut22
Copy link
Collaborator

Noting that the conversion of pari is near(ish), a consistent flag syntax would be ideal.

@speth suggested a convention of <verb>_<subject> like is_laminar or has_shaft for Boolean parameters, PLUS a string-based option selection for parameters that have more options (e.g icool can be opt_cooling which will be under engine). I would also vote to add a prefix for flags, e.g., flag_is_laminar, for ease of searching and identification in the codebase.

Thoughts/objections on this @everyone (@aditeyashukla @ngomezve @askprash )?
Making sure we all agree before trying to push beyond this sample HXfun.jl

@argonaut22
Copy link
Collaborator Author

argonaut22 commented Nov 4, 2024

Should we choose to proceed, here's a probably-not-but-maybe-comprehensive list of replacements on deck. all are booleans unless marked by *:

  • HXfun.jl
  • blsys for lam, wake, etc. all boolean
  • cdsum: icdfun
  • trefftz: Lspec
  • balance: iiengloc, iiHTsize, iixwmove*
  • tanksize: flag_size, flag_vacuum
  • fuselage_tank: size_insulation
  • tfan: icool*
  • aircraft: sized (also see Improve sized flag logic #99)
  • size_cabin: flag_aisle, fdoubledecker
  • everything in pari

@argonaut22
Copy link
Collaborator Author

As an example for how the string comparison would work, the comparison could be:

if engine.opt_cooling == "none"
    ...
elseif engine.opt_cooling == "fixed_BPRc"
    ...
elseif engine.opt_cooling == "fixed_Tmetal"
    ...
end

@argonaut22 argonaut22 self-assigned this Nov 4, 2024
@argonaut22 argonaut22 added the good first issue Good for newcomers label Nov 4, 2024
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.19%. Comparing base (430cfd8) to head (3bb98d1).
Report is 28 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
- Coverage   73.41%   73.19%   -0.23%     
==========================================
  Files          77       80       +3     
  Lines       13908    13459     -449     
==========================================
- Hits        10211     9851     -360     
+ Misses       3697     3608      -89     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@askprash
Copy link
Member

askprash commented Nov 5, 2024

This is good, we should do this! Personally, I'm not sure we need the flag_ prefix - just makes it longer, and there's something nice about reading if is_laminar in the code but not a strong opposition. For the option string variables though having the opt prefix seems nice.

Also for the string variables it would be good to lowercase() everything while testing to be consistent.

@argonaut22
Copy link
Collaborator Author

Consensus is flag_ not needed. Will incorporate the changes above in the next few days

@askprash
Copy link
Member

@argonaut22 is this one we can sort out for the release? It should also help get rid of some flags inside pari.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants