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

Feature: leading underscore to module imports #309

Merged
merged 8 commits into from
Nov 24, 2023

Conversation

SeRealMF
Copy link
Contributor

@SeRealMF SeRealMF commented Nov 16, 2023

Overview

Leading underscores were added to the module imports to make them private. This means that they are not accessible from outside the module and can only be used within the module itself.

Addressed issues

#270

Showcase

import splinepy as _splinepy

new, feature = _splinepy.tataratat()

@SeRealMF SeRealMF changed the title Ft local import Feature: leading underscore to module imports Nov 16, 2023
Copy link
Member

@j042 j042 left a comment

Choose a reason for hiding this comment

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

Thanks a lot!
Imports within the functions don't really need leading underscore - they are mostly in splinepy/helpme/create.py

tests/test_creator.py Outdated Show resolved Hide resolved
tests/test_creator.py Outdated Show resolved Hide resolved
Copy link
Member

@j042 j042 left a comment

Choose a reason for hiding this comment

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

I think we can leave function-local-import also this way for now. They are mainly for type checking and we can try to avoid in other PR. Thanks again!

This will cause some conflicts on other PRs (@jzwar, @FSchwar, @clemens-fricke), but other way around would cause bigger conflicts. So, I will merge this first

@jzwar
Copy link
Collaborator

jzwar commented Nov 23, 2023

When will this be merged? Is anything missing still?

@j042
Copy link
Member

j042 commented Nov 24, 2023

When will this be merged? Is anything missing still?

right now

@j042 j042 merged commit e052fbe into tataratat:main Nov 24, 2023
17 checks passed
mkofler96 pushed a commit to mkofler96/splinepy that referenced this pull request Dec 4, 2023
* added leading underscore

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added leading underscore

* direct module import

* fixed formatting

* bug fixes

* Apply suggestions from code review

* update contributing

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jaewook Lee <47114801+j042@users.noreply.github.com>
Co-authored-by: Jaewook Lee <jaewooklee042@gmail.com>
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.

3 participants