Skip to content

Add pandas to pyproject.toml #964

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

Closed

Conversation

KybernetikJo
Copy link
Contributor

Adds pandas to pyproject.toml.

Allows optional install

pip install control[pandas]
pip install control[pandas,slycot]
...

@coveralls
Copy link

coveralls commented Jan 22, 2024

Coverage Status

coverage: 94.784%. remained the same
when pulling ac5a4d1 on KybernetikJo:add_pandas_to_pyproject
into a8a54d1 on python-control:main.

@KybernetikJo KybernetikJo force-pushed the add_pandas_to_pyproject branch from 615e774 to fa9dae2 Compare January 22, 2024 18:52
@bnavigator
Copy link
Contributor

I don't really see a big enough benefit of adding a single optional well known package with the same name as the package.

What's the effective difference between pip install control pandas and pip install 'control[pandas]'?

@bnavigator
Copy link
Contributor

FTR, I am guilty of starting that kind of extra with Slycot in #678. Probably would not do it again.

@KybernetikJo
Copy link
Contributor Author

KybernetikJo commented Jan 22, 2024

What's the effective difference between pip install control pandas and pip install 'control[pandas]'?

You are right. There is no real difference. It was just for the sake of completeness.

What do you think about a pip install[full] or pip install[all]?

[project.optional-dependencies]
test = ["pytest", "pytest-timeout"]
slycot = [ "slycot>=0.4.0" ]
cvxopt = [ "cvxopt>=1.2.0" ]
pandas = [ "pandas>=1.5.0" ]
all = [
    "control[test]",
    "control[slycot]",
    "control[cvxopt]",
    "control[pandas]",
    ]

or

[project.optional-dependencies]
test = ["pytest", "pytest-timeout"]
all = [
    "control[test]",
    "slycot>=0.4.0" ]
    "cvxopt>=1.2.0" ,
    "pandas>=1.5.0" ,
    ]

https://hynek.me/articles/python-recursive-optional-dependencies/

I do not have strong feelings about it. I am OK not merging it.

@KybernetikJo
Copy link
Contributor Author

KybernetikJo commented Jan 23, 2024

I don't really see a big enough benefit of adding a single optional well known package with the same name as the package.

What's the effective difference between pip install control pandas and pip install 'control[pandas]'?

These are valid points, so I looked for other projects that use the pattern. I was able to find two well known packages:

The reason could be

  • to document all dependencies (also optional) in pyproject.toml
  • to indicate that a single option is a valid installation pip install control[pandas]
  • to ensure the right version of optional packages
    • pip install control[slycot] is actually pip install "slycot>=0.4.0" control
    • pip install control[pandas] would be pip install "pandas>=1.5.0" control

Remark:
Well, the benefits don't seem to be big enough. I will keep the PR open for a few weeks, and then I will close it.

@KybernetikJo
Copy link
Contributor Author

Well, the benefits were not big enough.

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