mdolab / pygeo

pyGeo provides geometric design variables and constraints suitable for gradient-based optimization.
https://mdolab-pygeo.readthedocs-hosted.com/en/latest/?badge=latest
Apache License 2.0
124 stars 55 forks source link

Pass the DVname of VSP design variable to vspDV class #156

Closed ArshSaja closed 2 years ago

ArshSaja commented 2 years ago

Purpose

The DVname in vspDV class was set to None. Thus, when dv.name is called, it returns None. This PR fixes this issue.

Expected time until merged

Type of change

Testing

Checklist

codecov[bot] commented 2 years ago

Codecov Report

Merging #156 (fe9ed38) into main (c5cda6d) will decrease coverage by 10.81%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##             main     #156       +/-   ##
===========================================
- Coverage   63.90%   53.08%   -10.82%     
===========================================
  Files          47       47               
  Lines       11757    11757               
===========================================
- Hits         7513     6241     -1272     
- Misses       4244     5516     +1272     
Impacted Files Coverage Δ
pygeo/parameterization/DVGeoVSP.py 81.43% <100.00%> (ø)
pygeo/parameterization/designVars.py 77.65% <100.00%> (ø)
pygeo/parameterization/DVGeoMulti.py 0.39% <0.00%> (-89.38%) :arrow_down:
pygeo/constraints/areaConstraint.py 50.50% <0.00%> (-25.42%) :arrow_down:
pygeo/constraints/DVCon.py 68.04% <0.00%> (-3.69%) :arrow_down:
pygeo/pyBlock.py 45.37% <0.00%> (-1.65%) :arrow_down:
pygeo/parameterization/DVGeo.py 64.23% <0.00%> (-1.44%) :arrow_down:
pygeo/topology.py 54.92% <0.00%> (-0.23%) :arrow_down:
pygeo/__init__.py 91.30% <0.00%> (+8.69%) :arrow_up:
pygeo/parameterization/__init__.py 88.88% <0.00%> (+11.11%) :arrow_up:

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

joanibal commented 2 years ago

Can you provide more context here. Was the code broken before? What is wrong with using dv.name?

ArshSaja commented 2 years ago

For openvsp, since we don't pass the DV name in vspDV class, we set the name of DV as None. Since all of our VSP related work is done mphys, we haven't noticed that issue in MACH. The key is the DV name for both vsp and esp. So, it won't affect anything.

hajdik commented 2 years ago

For openvsp, since we don't pass the DV name in vspDV class, we set the name of DV as None.

Is there a reason we couldn't add names to VSP DVs to keep a more consistent API across the different DVGeo types and DV types? The name is already present in as the key in self.DVs, right?

ArshSaja commented 2 years ago

I changed it to the default case. Now the DV name is passed to the vspDV class.

eirikurj commented 2 years ago

@ArshSaja can you update the PR name and purpose to be consistent with the content

ArshSaja commented 2 years ago

I updated the PR details. @eirikurj