utiasDSL / safe-control-gym

PyBullet CartPole and Quadrotor environments—with CasADi symbolic a priori dynamics—for learning-based control and RL
https://www.dynsyslab.org/safe-robot-learning/
MIT License
560 stars 123 forks source link

Adding pytest to the pytoml #117

Closed Federico-PizarroBejarano closed 1 year ago

Federico-PizarroBejarano commented 1 year ago

I think pytest should be on the pytoml since its useful for locally running the tests. However, using poetry add pytest isn't working for me, fails due to some error in updating casadi. Not sure if someone with more poetry experience could fix this.

JacopoPan commented 1 year ago

A few questions:

More generally, what is the use case that is not currently supported and should be covered?

Federico-PizarroBejarano commented 1 year ago
amrit110 commented 1 year ago

Hi @Federico-PizarroBejarano not sure if this has been resolved but in your dev-experiment-class you can simply add pytest as a dependency. You can do this using poetry add pytest or poetry add --group test pytest if you wish to group your dependencies (https://python-poetry.org/docs/master/managing-dependencies/#dependency-groups), and then do poetry install to install pytest as part of the virtual environment.

Ok, the issue with casadi seems to be that poetry is having issues finding the right casadi version, so that can be fixed by changing line 22 in pyproject.toml to casadi = "3.5.5", i.e. removing the ^.

amrit110 commented 1 year ago

@JacopoPan I can submit a PR to resolve the issue with casadi based on what you think. I also think that the poetry.lock file can be added so that it doesn't resolve dependencies dynamically every time and just installs the environment that has been tested to work. As another additional point, we could also release safe-control-gym as a package via PyPI. This will increase the useability of what you have developed. Would like to hear your thoughts on that!

Federico-PizarroBejarano commented 1 year ago

@amrit110 thank you! I have no idea how poetry works so any help is really appreciated. Idk about the other issues, but if you could do a PR to dev-experiment-class to fix the pytest and toml file issues that would be great, a lock file sounds good to me but idk about @JacopoPan . Thanks again

JacopoPan commented 1 year ago

@amrit110

yes please on the PR to branch dev-experiment-class for the poetry points I also agree with PyPI (it was in the works with the summer interns last year) but I would wait until after the next release/big update on main