Skip to content

fix: move adding arithmetic resources from preprocessing to compilation - #190

Merged
mstechly merged 3 commits into
mainfrom
mstechly/fix-derived-resources-issue
Apr 28, 2025
Merged

fix: move adding arithmetic resources from preprocessing to compilation#190
mstechly merged 3 commits into
mainfrom
mstechly/fix-derived-resources-issue

Conversation

@mstechly

Copy link
Copy Markdown
Contributor

Description

This PR fixes a bug where additive/multiplicative resources added as derived_resources would not count towards the sum/product for the parent.
It achieves it by moving the logic of the preprocessing step into the compilation logic.

Please verify that you have completed the following steps

  • I have self-reviewed my code.
  • I have included test cases validating introduced feature/fix.
  • I have updated documentation.

@Brendan-Reid1991 Brendan-Reid1991 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice! no major changes apart from docstrings

Comment thread src/bartiq/compilation/_compile.py Outdated
This step generates such resources for the parent.

Args:
routine: routine to be preprocessed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

First input has changed to resources, similarly with the Returns section below, looks like a simple case of docstring getting out of sync with functionality!

@mstechly
mstechly merged commit f6ac145 into main Apr 28, 2025
@mstechly
mstechly deleted the mstechly/fix-derived-resources-issue branch April 28, 2025 15:55
Brendan-Reid1991 pushed a commit that referenced this pull request May 21, 2025
…on (#190)

* fix: move adding arithmetic resources from preprocessing to compilation

* docs: update docstrings

* test: increase the timeout for a long test
Brendan-Reid1991 pushed a commit that referenced this pull request May 21, 2025
…on (#190)

* fix: move adding arithmetic resources from preprocessing to compilation

* docs: update docstrings

* test: increase the timeout for a long test
Brendan-Reid1991 pushed a commit that referenced this pull request May 21, 2025
…on (#190)

* fix: move adding arithmetic resources from preprocessing to compilation

* docs: update docstrings

* test: increase the timeout for a long test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants