Skip to content

Added the XYZREF vector as a differentiated variable - #42

Merged
joanibal merged 8 commits into
joanibal:mainfrom
sabakhshi:bakhshi_patch4
Oct 15, 2025
Merged

joanibal merged 8 commits into
joanibal:mainfrom
sabakhshi:bakhshi_patch4

Conversation

@sabakhshi

Copy link
Copy Markdown
Collaborator

Adds the XYZREF vector as a differentiated variable. Was accidentally added in the dictionary input PR but is now separated. All tests pass. Do not merge until dictionary input PR is merged.

@sabakhshi
sabakhshi requested a review from joanibal October 15, 2025 19:58
Comment thread optvl/optvl_class.py Outdated
blk += self.ad_suffix
var += self.ad_suffix
val = ref_seeds[ref_key] * scale
val = ref_seeds[ref_key] * scale * np.ones(3) if ref_key == "XYZref" else ref_seeds[ref_key] * scale

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What is going on here. Shouldn't ref_seeds[ref_key] have a shape of 3? A scalar value implies the three components will share one AD seed value which should not be the case.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It should. The tests were automatically making the seed 1.0 for everything and do avoid having changes across each test I thought I get it all here. Now I realize this function is also used by the actual sensitivity evaluations as well.

@sabakhshi
sabakhshi requested a review from joanibal October 15, 2025 20:26
@joanibal
joanibal merged commit d60637a into joanibal:main Oct 15, 2025
22 checks passed
@sabakhshi
sabakhshi deleted the bakhshi_patch4 branch October 15, 2025 20:49
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