-
Notifications
You must be signed in to change notification settings - Fork 4
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
get_exe_path is a bit noisy + question #359
Comments
Good point on lowering the debug level! Plus, maybe we should change a default value to get_exe_path(.., version_tag="latest").
Currently, the executable that is last installed on your system and matches the version_tag and repo(if version_tag is not None). It doesn't discriminate against different environments. Why did you perform step 4? Thus since you explicitly downloaded the binaries again with step 4, I would presume the path of the last install in step 4. The executables installed during the first step would the the ones used if step 4 was not performed. If not, something is off. Could you have a look at this file: "flopy_metadata_fp = flopy_appdata_path / "get_modflow.json"? The last in line that matches version_tag and repo would be the path returned. We could change this behavior of course. |
PATH is not considered here |
Wait, this was not completely true. The following conditional is there as well: if nlmod_bindir in flopy_bindirs:
return nlmod_bindir
if flopy_bindirs:
# Get most recent directory
return flopy_bindirs[-1]
# Else download the executables
if download_if_not_found: |
Alright, I understand it better now :).
This sounds logical to me, and is more explicit. As for your question:
I was curious whether there were new binaries available in a certain environment so I quickly used nlmod functions to download the latest ones for that environment. Then in the other environment I was running some models using the flopy binaries, but using
I thought environments had be respected also for the binaries, but I understand now it just plucks the most recent location from the flopy metadata JSON file (given no binaries were installed in the current active environment)? So the philosophy is more along the lines, "you asked for a specific version, so I'll give you one that matches, regardless of where it's located". The one worry I have is that And if I want to override that behavior and find a specific binary, I can get |
What is you view on:
An additional question to all:
|
I'm for defaulting to "latest" and documenting that it is a good idea to think about pinning mf6 versions for projects. I think pinning versions in nlmod will be a bit too annoying in development. It would be nice to be able to easily figure out what version_tag "latest" corresponds to, and/or which version of mf6 is contained within a specific version tag.
I do like seeing the path in my model dataset, that gives me confidence that it's using the right binary to run the model. Maybe that's old fashioned thinking though? I'm fine with adding repo/version tag to make it more transferable though, as long as I don't have to type more 😇 . |
So that makes it 1 vs. 1 ;)
@OnnoEbbens, @rubencalje would you like to cast a vote? I don't think we should do both as they can get out of sync. |
I'd be happy to switch my vote if Also it would be nice to quickly extract the mf6 version from some version_tag: |
BTW, I lowered the log level to DEBUG in 45c25be. Leaving this issue open for the other discussion on |
I'm getting a lot of this message (shown below) in my script, every time I call
nlmod.util.get_exe_path()
. When I pass aversion_tag
, it still logs messages. Maybe DEBUG level logging is sufficient, or maybe this message isn't very interesting?Also a question, I just want to use the modflow binaries downloaded using flopy, how do I get nlmod to find that file? The binaries are available on my path so typing
mf6
in my terminal gets me the right mf6 version. From my environment (wherenlmod
does not have any binaries downloaded),nlmod.util.get_exe_path()
is now preferring its own binary directory in different environments instead of the flopy directory that's included in my PATH environment variable. I thought maybe this had to do with editable installs in different environments, but it also found the binaries in an environment where I installednlmod
withpip install .
.Chances are fairly large that I've just messed up my environments too much, but I wanted to check here whether anyone else has observed similar behavior?
Steps to maybe reproduce:
get-modflow :flopy
nlmod.util.get_exe_path("mf6")
.The text was updated successfully, but these errors were encountered: