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

TYP: add type hints to functional._dimension #534

Merged
merged 3 commits into from
Jan 12, 2024

Conversation

martinfleis
Copy link
Member

I suppose this is how typing in momepy can look? Is that an improvement? Shall we do it?

@martinfleis martinfleis requested a review from jGaboardi January 12, 2024 10:32
@martinfleis martinfleis self-assigned this Jan 12, 2024
@@ -11,7 +14,10 @@
]


def volume(area, height):
def volume(
area: NDArray[np.float_] | Series,
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we can do with a bare NDArray? Since I don't know how to add the same to Series anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Did you try: Series[np.float_]

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@jGaboardi jGaboardi left a comment

Choose a reason for hiding this comment

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

Looks good.

@@ -11,7 +14,10 @@
]


def volume(area, height):
def volume(
area: NDArray[np.float_] | Series,
Copy link
Member

Choose a reason for hiding this comment

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

Did you try: Series[np.float_]

@jGaboardi
Copy link
Member

Let's merge then. Can always adjust later if we figure it out.

@martinfleis martinfleis merged commit 29c0e5d into pysal:main Jan 12, 2024
10 checks passed
@martinfleis martinfleis deleted the types branch January 12, 2024 21:36
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