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

Refactor: create trace.py #408

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

dianzrong
Copy link
Collaborator

@dianzrong dianzrong commented Jul 19, 2023

What kind of change does this PR introduce?

Refactoring

Summary

Refactor the trace code from record.py to trace.py. Addresses #387

Checklist

  • My code follows the style guidelines of OpenAdapt
  • I have performed a self-review of my code
  • If applicable, I have added tests to prove my fix is functional/effective
  • I have linted my code locally prior to submission
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. README.md, requirements.txt)
  • New and existing unit tests pass locally with my changes

How can your code be run and tested?

Can be tested through running record.py

@dianzrong dianzrong marked this pull request as ready for review July 21, 2023 01:38
Copy link
Collaborator

@angelala3252 angelala3252 left a comment

Choose a reason for hiding this comment

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

some small things, otherwise looks good!

openadapt/trace.py Outdated Show resolved Hide resolved
openadapt/trace.py Outdated Show resolved Hide resolved
@abrichr
Copy link
Contributor

abrichr commented Jul 25, 2023

@dianzrong can you please fix merge conflicts and add a test?

At a minimum we want a smoke test that looks like, e.g.:

def test_trace():
    @trace()
    def foo():
        pass

If you really want to you can simulate some function calls and look in stdout to make sure the calls are logged but it's not necessary.

openadapt/trace.py Outdated Show resolved Hide resolved
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

3 participants