MilesCranmer / PySR

High-Performance Symbolic Regression in Python and Julia
https://astroautomata.com/PySR
Apache License 2.0
2.19k stars 207 forks source link

[Feature] Install with CLI #229

Closed MilesCranmer closed 1 year ago

MilesCranmer commented 1 year ago

Right now you install SymbolicRegression.jl using python -c 'import pysr; pysr.install()'. However, this is a bit of spooky action at a distance, because you can't quite be sure which pysr is actually being called. Thus, it would be great if there was a CLI, similar to how testing is done with python -m pysr.test main. For example:

python -m pysr.install

If anybody wants to add this, I'd be more than happy to accept a PR!

w2ll2am commented 1 year ago

Hey, I'm new to this project and community but it looks like a fantastic tool with a huge range of applications! I'm a software engineer with an academic background in Physics and DS/ML. I'm looking to try and make a first contribution to your open source project, and this issue seems like a good contender.

I just wanted to clarify that the issue involves implementing the following:

  1. Create a script that runs pysr.install() when python -m pysr.install is run in the console.
  2. Create an appropriate test to cover this script.

Please do let me know if I've got the right idea to begin working on the issue!

MilesCranmer commented 1 year ago

Hi @w2ll2am,

Thanks so much for offering to work on this, sounds great! I confirm your suggested steps, although, thinking about it now, perhaps it might be better to have the CLI be python -m pysr install (space rather than dot). You will likely want to add a __main__.py file to the source folder, maybe with a click-based CLI. The CLI options could be the same as the arguments to the pysr.install() command.

Cheers! Miles

MilesCranmer commented 1 year ago

Fixed from #298