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

Make the macros module into a subpackage #2

Open
blakeaw opened this issue May 24, 2023 · 1 comment
Open

Make the macros module into a subpackage #2

blakeaw opened this issue May 24, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@blakeaw
Copy link
Owner

blakeaw commented May 24, 2023

Maybe it would be cleaner or easier to understand if the macros were organized into their own type-specific modules. Something like macros.pk, macros.pd, and macros.dose for PK, PD, and dosing functions respectively.

In this case, the current macros module under pysb.pkpd.macros would be converted into a sub-package. The modules inside that sub-package could then be imported in the pkpd level __init__.py to give a shortcut where they could be imported like from pysb.pkpd import pk, pd, dose. Then users could call those like pk.clearance(...), pd.emax(...), or dose.bolus(...) when building their own model, which may make it more readable and easier to differentiate the PD and dose functions from the PK ones.

@blakeaw blakeaw added the enhancement New feature or request label May 24, 2023
@blakeaw
Copy link
Owner Author

blakeaw commented Jun 30, 2024

Using pd for PD macros could potentially cause clashes with pandas, which is usually shortened to pd during import: import pandas as pd. This is something else to keep in mind. However, most users won't use pandas when encoding a model, so it probably won't be a big issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant