Skip to content
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

PySR should check SymbolicRegression.jl version #203

Closed
MilesCranmer opened this issue Oct 10, 2022 · 6 comments
Closed

PySR should check SymbolicRegression.jl version #203

MilesCranmer opened this issue Oct 10, 2022 · 6 comments
Assignees

Comments

@MilesCranmer
Copy link
Owner

SymbolicRegression.jl now has a PACKAGE_VERSION constant – this should be used by PySR to verify that the correct version is being imported. In practice, this probably not needed since PySR is managing the installs, but a user might have SymbolicRegression.jl installed in their base env, which might get imported instead. better to verify the version explicitly.

@MilesCranmer MilesCranmer self-assigned this Oct 10, 2022
@tecosaur
Copy link

Why don't you check the version using Pkg ?

@MilesCranmer
Copy link
Owner Author

They are only adding it to Julia 1.9: JuliaLang/julia#45607. For LTS versions I think I need this constant parameter. What do you think?

@tecosaur
Copy link

Hmm, how long has Pkg.Types.read_package been around for? If that's somewhat stable you could do Pkg.Types.read_package(abspath(pathof(SymbolicRegression), "..", "..", "Project.toml")).version

@MilesCranmer
Copy link
Owner Author

Here’s the current approach: https://github.com/MilesCranmer/SymbolicRegression.jl/blob/cce9fda3d1fc6493b9d41ee92c6c630cb1944b95/src/SymbolicRegression.jl#L114. I guess the question is whether you’d want to do this inside PySR or SymbolicRegression.jl (and then just check the constant).

@tecosaur
Copy link

I'd be tempted to suggest this should be checked on the python side, since Julia already has its ways of dealing with version requirements.

@MilesCranmer
Copy link
Owner Author

Implemented a while back so closing. Cheers!

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

No branches or pull requests

2 participants