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

Create test_norm2mort.py #2

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

Create test_norm2mort.py #2

wants to merge 1 commit into from

Conversation

GTBC0
Copy link

@GTBC0 GTBC0 commented Sep 26, 2022

No description provided.

Copy link
Owner

@espg espg left a comment

Choose a reason for hiding this comment

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

...need to use the assert keyword for this to be a unit test. General practice is to create a folder (tests) for all the unit tests, and then import the functions that you are testing using relative imports-- see here and here for how the file hierarchy is setup...

import numpy as np

@vectorize([int64(int64, int64, int64)])
def fastNorm2Mort(order, normed, parents):
Copy link
Owner

Choose a reason for hiding this comment

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

You don't need to copy the function-- you can just import it from the other file; i.e.:

from tools import fastNorm2Mort

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