CALFEM / calfem-python

CALFEM for Python is the Python port of the CALFEM finite element toolkit. It also implements meshing function based on GMSH and triangle. Visualisation routines are implemented using visvis and matplotlib.
MIT License
115 stars 189 forks source link

Creating optional dependencies #60

Open Martin15135215 opened 9 months ago

Martin15135215 commented 9 months ago

It is also known as extras

currently, I also use this library to solve truss system like those

I do not require the dependencies, for example the Vis component of this library. Would it be possible to incorporate them as extras?

Thank you very much and have a happy new year.

jonaslindemann commented 9 months ago

I am planning to do this. I have not yet had time. Thanks for the feedback! There is also calfem-python-small.

Martin15135215 commented 9 months ago

Thanks for pointing me to calfem-python-small. I did not know it, since it was not mentioned https://github.com/CALFEM/calfem-python or https://calfem-for-python.readthedocs.io/en/latest/installation.html

I then looked further and found it in the https://github.com/CALFEM/calfem-python/blob/master/setup.py and https://github.com/CALFEM/calfem-python/blob/master/setup-org.py

calfem-python-small has the following dependencies:

https://github.com/CALFEM/calfem-python/blob/8c9746482e6545c461aad440ee4d9fba7201f447/setup.py#L92

calfem-python has the following dependencies:

https://github.com/CALFEM/calfem-python/blob/8c9746482e6545c461aad440ee4d9fba7201f447/setup-org.py#L92

Is the difference just the number of installed dependencies between these two versions?

Here is the link how to do optional dependencies in setup.py

setup(
    name="Package-A",
    ...,
    extras_require={
        "PDF": ["ReportLab>=1.2", "RXP"],
    },
)