DanieleGioia / ScenarioReducer

This library implements several approximate scenario reduction algorithms. Given a probability distribution with finite support, they aim to determine a probability measure with support of reduced and fixed cardinality by selecting the closest to the original one in terms of a selected statistical distance.
MIT License
6 stars 3 forks source link

Make package pip installable #5

Closed pdb5627 closed 1 year ago

pdb5627 commented 1 year ago

@DanieleGioia How would you feel about a PR to make this project pip-installable? That could make it easier for other projects to utilize. I think it just needs some reorganization of files to make it a package and then a pyproject.toml. If you're interested, I'm happy to do the work.

DanieleGioia commented 1 year ago

Actually, I have never generated a pip-installable. It would be an opportunity to try, so yes, gladly.

DanieleGioia commented 1 year ago

@pdb5627 I pushed a setup.py and updated the init inside the ScenarioRed folder with the version and authors. Please fill free to add your mail/name! If you like, you can give a check and if it seems ok, I will then proceed with the PyPI upload.

pdb5627 commented 1 year ago

I used pip to install the current git version in a conda environment, and it worked. Good job! I'm fairly new to Python packaging myself, but from what I've seen, pyproject.toml is now recommended instead of setup.py. Here's a good introduction: https://drivendata.co/blog/python-packaging-2023/.

DanieleGioia commented 1 year ago

I replaced the setup with a toml. I uploaded the package on PyPI and is now available. If you want to add yourself as a contributor in the metadata, please feel free to do so. I tried to pip-installing and everything seems fine. I also updated the readme and added a changelog file. Since the first release is out, I'll close the issue.