You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Accessing an environment in a platform independent way. #2
This works, but I know the existence of the pixi.toml. I could also build an environment using the following java program.
importorg.apposed.appose.*;
importjava.util.*;
publicclassApposeBuilder{
//Toml to create a cellpose environment.staticfinalStringtoml = """[workspace] authors = [ "Smith, MB", ] channels = ["conda-forge"] name = "example-appose" platforms = ["osx-arm64", "win-64", "linux-64", "osx-64"] version = "0.1.0" [dependencies] python = ">3.10.3" [pypi-dependencies] cellpose = ">=4" appose = ">=0.10.1"""";
finalstaticStringcommand = """import cellpose, sys, pathlibex = pathlib.Path(sys.executable)#I could use this value with "wrap"env = ex.parent.parent#I can use this value with script parameter.toml = env.parent.parent.parent / "pixi.toml""%s"%(toml, )""";
publicstaticvoidmain(String[] args) throwsException{
try( Servicepython = Appose.pixi().content(toml).build().python() ){
Map<String, Object> inputs = newHashMap<>();
Service.Tasktask = python.task(command, inputs);
task.start();
task.waitFor();
System.out.println(task.result());
}
}
}
If I run that java program, then I will have a python environment with cellpose, and I know the location of the the pixi.toml that I need to point the script engine at. It would be nice if there was a consistent, platform independent way of naming/referencing an environment.
Activity