Skip to content

Adding gen_at_report plus unit tests #2915

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jeffng-or
Copy link
Contributor

Committing gen_at_report.py scripts for extracting information related to AutoTuner runs. Provided to customer as an example.

Includes unit tests which cover 90%+ of the statements

@jeffng-or jeffng-or requested review from luarss and vvbandeira March 7, 2025 18:38
@jeffng-or jeffng-or force-pushed the at-gen_at_report branch 2 times, most recently from 4566089 to d937d5d Compare March 7, 2025 18:50
lint fixes
one more lint fix
moved gen_at_report and associated files from utils to scripts

Signed-off-by: Jeff Ng <jeffng@precisioninno.com>
@jeffng-or
Copy link
Contributor Author

Tests were dying due to an import issue with utils. I wonder if we should rename either utils.py or the utils directory to avoid confusion. Usually, you don't have a file and a directory with effectively the same name.

# To get relative imports to work
import os, sys

sys.path.append(os.path.dirname(os.path.realpath(__file__)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I wasn't real happy with the solution either, but was struggling to make it work with the unit tests plus calling from a script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@luarss , I remember now. I added the relative imports because I wanted to be able to run the script from within my local workspace. My understanding, which might be wrong, was the pyproject.toml works for when you publish the package, but maybe not within the local workspace. Is my understanding wrong?

Copy link
Contributor

@luarss luarss Mar 28, 2025

Choose a reason for hiding this comment

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

No - it should work as long as you have the Python virtual environment activated. In your case, it should import something like:

To use the scripts:

from autotuner.scripts import moduleA, moduleB

For this init.py, it then can be empty

## POSSIBILITY OF SUCH DAMAGE.
###############################################################################

from datetime import datetime
Copy link
Contributor

@luarss luarss Mar 8, 2025

Choose a reason for hiding this comment

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

Could this be placed in utils/? Any user created libs that we have to import .

Then we can add utils to the [tool.setuptools.packages.find] section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I originally had it in utils, but moved it due to the possible name collision with utils. I'll try re-PR'ing after the dust settles

@luarss
Copy link
Contributor

luarss commented Mar 8, 2025

We should probably rename the utils.py file as well - maybe a separate PR?

@jeffng-or
Copy link
Contributor Author

We should probably rename the utils.py file as well - maybe a separate PR?

probably a good idea

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