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

Base class for DVGeos #130

Merged
merged 33 commits into from
Apr 22, 2022
Merged

Base class for DVGeos #130

merged 33 commits into from
Apr 22, 2022

Conversation

hajdik
Copy link
Contributor

@hajdik hajdik commented Mar 25, 2022

Purpose

This is pretty much ready for review now, the biggest lingering questions are what the new classes should be named and if there are more functions that can be brought up a level after some refactoring.

Addresses #125. There is repeated code and similar structures between the different DVGeo classes, resulting in issues when there are changes in the API. There is now an abstract base class, BaseDVGeo, that all DVGeo classes will inherit from, as well as an intermediate class, DVGeoSketch, for DVGeoESP and DVGeoVSP to inherit from due to the large amount of shared code.

There is also a base class for design variables now to unify the different implementations better.

Expected time until merged

Maybe a week now that it's closer to complete, there's no rush

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

I do not believe any additional tests will be needed, the functionality should be the same so if the original tests pass this should be good.

Checklist

  • I have run flake8 and black to make sure the code adheres to PEP-8 and is consistently formatted
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@codecov
Copy link

codecov bot commented Mar 25, 2022

Codecov Report

Merging #130 (43808ec) into main (7484ec5) will increase coverage by 0.01%.
The diff coverage is 81.65%.

@@            Coverage Diff             @@
##             main     #130      +/-   ##
==========================================
+ Coverage   62.60%   62.61%   +0.01%     
==========================================
  Files          43       45       +2     
  Lines       11207    11217      +10     
==========================================
+ Hits         7016     7024       +8     
- Misses       4191     4193       +2     
Impacted Files Coverage Δ
pygeo/parameterization/DVGeoSketch.py 69.76% <69.76%> (ø)
pygeo/parameterization/BaseDVGeo.py 70.00% <70.00%> (ø)
pygeo/parameterization/DVGeoESP.py 64.83% <75.00%> (-0.66%) ⬇️
pygeo/parameterization/designVars.py 76.71% <97.77%> (+1.84%) ⬆️
pygeo/parameterization/DVGeo.py 64.37% <100.00%> (+0.06%) ⬆️
pygeo/parameterization/DVGeoVSP.py 81.40% <100.00%> (+0.15%) ⬆️
pygeo/geo_utils/misc.py 38.46% <0.00%> (+7.69%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Contributor

@sseraj sseraj left a comment

Choose a reason for hiding this comment

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

I think this is a good start. Some comments below

.gitignore Outdated Show resolved Hide resolved
pygeo/parameterization/BaseDVGeo.py Outdated Show resolved Hide resolved
pygeo/parameterization/BaseDVGeo.py Outdated Show resolved Hide resolved
pygeo/parameterization/DVGeoSketch.py Outdated Show resolved Hide resolved
@hajdik hajdik marked this pull request as ready for review April 12, 2022 01:55
@hajdik hajdik requested a review from a team as a code owner April 12, 2022 01:55
Copy link
Contributor

@marcomangano marcomangano left a comment

Choose a reason for hiding this comment

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

I am not really familiar with abstract methods and how to exploit them, but I think a couple of fixes might be needed here.
Also, pls check for more leftover comments over the PR

pygeo/parameterization/DVGeo.py Outdated Show resolved Hide resolved
pygeo/parameterization/DVGeo.py Outdated Show resolved Hide resolved
pygeo/parameterization/DVGeoSketch.py Outdated Show resolved Hide resolved
pygeo/parameterization/DVGeoSketch.py Outdated Show resolved Hide resolved
pygeo/parameterization/BaseDVGeo.py Outdated Show resolved Hide resolved
pygeo/parameterization/BaseDVGeo.py Outdated Show resolved Hide resolved
@ewu63 ewu63 self-requested a review April 12, 2022 15:49
Copy link
Collaborator

@ewu63 ewu63 left a comment

Choose a reason for hiding this comment

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

Overall I think there should be more things that we can pull out, but maybe that needs a bigger refactoring. See specific comments below

pygeo/parameterization/BaseDVGeo.py Outdated Show resolved Hide resolved
pygeo/parameterization/DVGeo.py Show resolved Hide resolved
pygeo/parameterization/BaseDVGeo.py Outdated Show resolved Hide resolved
@sseraj
Copy link
Contributor

sseraj commented Apr 13, 2022

The tests are hanging. I tried cancelling the build, but Azure is slow to respond. Testing locally first would be ideal

@hajdik
Copy link
Contributor Author

hajdik commented Apr 14, 2022

They were passing locally, I'll look into it later today.

Copy link
Collaborator

@joanibal joanibal left a comment

Choose a reason for hiding this comment

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

I'm confused by some of the abstract class and methods stuff.

pygeo/parameterization/BaseDVGeo.py Outdated Show resolved Hide resolved
pygeo/parameterization/DVGeoSketch.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@ewu63 ewu63 left a comment

Choose a reason for hiding this comment

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

This looks good to me, but I'd appreciate other diligent reviews

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.

None yet

5 participants