Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit 00a1960

Browse files
committed
Remove the possibility to install the kernel from Fiji.
1 parent f1a45c6 commit 00a1960

5 files changed

Lines changed: 2 additions & 286 deletions

File tree

README.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The kernel has been originally created to work with ImageJ. See [here](https://i
1818

1919
A documentation is available as a series of notebooks [here](./notebooks/Welcome.ipynb).
2020

21-
## Installation - Standalone
21+
## Installation
2222

2323
- Install [Anaconda](https://www.continuum.io/downloads)
2424
- Install `scijava-jupyter-kernel` with :
@@ -47,25 +47,7 @@ jupyter notebook
4747
jupyter lab
4848
```
4949

50-
*Note : It is suggested to install the kernel in an isolated Conda environment (not in the root environment).*
51-
52-
## Installation - With Fiji integration
53-
54-
- [Download](https://imagej.net/Fiji/Downloads) the last Fiji release.
55-
- Add the *Scijava Jupyter Kernel* update site in Fiji:
56-
- Click [Help ▶ Update...](https://imagej.net/Update_Sites).
57-
- Click `Manage update sites`.
58-
- Select the *Scijava Jupyter Kernel* checkbox (see also [List of update sites](https://imagej.net/List_of_update_sites)).
59-
- Click `Apply changes` and restart Fiji.
60-
61-
- Launch `Analyze > Jupyter Kernel > Install Scijava Kernel`.
62-
- Set the path to your Python binary.
63-
- Choose a log level.
64-
65-
- Check the kernel has been installed with : `jupyter kernelspec list`.
66-
- Launch `jupyter notebook` or `jupyter lab` and **select the kernel you want in the kernel list**.
67-
68-
![Scijava Jupyter Kernel Installation](teaser.gif)
50+
*Note : It is strongly suggested to install the kernel in an isolated Conda environment (not in the root environment).*
6951

7052
## Development
7153

src/main/java/org/scijava/jupyter/commands/InstallScijavaKernel.java

Lines changed: 0 additions & 168 deletions
This file was deleted.

src/main/java/org/scijava/jupyter/service/DefaultJupyterService.java

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.apache.commons.cli.ParseException;
3838
import org.scijava.Context;
3939
import org.scijava.command.CommandService;
40-
import org.scijava.jupyter.commands.InstallScijavaKernel;
4140
import org.scijava.jupyter.kernel.ScijavaKernel;
4241
import org.scijava.jupyter.kernel.configuration.ScijavaKernelConfigurationFile;
4342
import org.scijava.jupyter.kernel.evaluator.ScijavaEvaluator;
@@ -63,48 +62,6 @@ public class DefaultJupyterService extends AbstractService implements JupyterSer
6362
@Parameter
6463
private transient CommandService command;
6564

66-
/* Install kernel */
67-
@Override
68-
public void installKernel(String... args) {
69-
Map<String, Object> parameters = parseArgumentsInstall(args);
70-
// TODO : Ensure parameters contains the appropriate keys.
71-
72-
installKernel((String) parameters.get("logLevel"),
73-
(String) parameters.get("pythonBinaryPath"),
74-
(String) parameters.get("classpath"),
75-
(String) parameters.get("javaBinaryPath"));
76-
}
77-
78-
@Override
79-
public void installKernel(String logLevel, String pythonBinaryPath) {
80-
installKernel(logLevel, Paths.get(pythonBinaryPath));
81-
}
82-
83-
@Override
84-
public void installKernel(String logLevel, Path pythonBinaryPath) {
85-
installKernel(logLevel, pythonBinaryPath.toFile());
86-
}
87-
88-
@Override
89-
public void installKernel(String logLevel, File pythonBinaryPath) {
90-
installKernel(logLevel, pythonBinaryPath, null, null);
91-
}
92-
93-
@Override
94-
public void installKernel(String logLevel, String pythonBinaryPath, String classpath, String javaBinaryPath) {
95-
installKernel(logLevel, new File(pythonBinaryPath), classpath, javaBinaryPath);
96-
}
97-
98-
@Override
99-
public void installKernel(String logLevel, File pythonBinaryPath, String classpath, String javaBinaryPath) {
100-
Map<String, Object> parameters = new HashMap<>();
101-
parameters.put("logLevel", logLevel);
102-
parameters.put("pythonBinaryPath", pythonBinaryPath);
103-
parameters.put("classpath", classpath);
104-
parameters.put("javaBinaryPath", new File(javaBinaryPath));
105-
command.run(InstallScijavaKernel.class, true, parameters);
106-
}
107-
10865
/* Run kernel */
10966
@Override
11067
public void runKernel(String... args) {
@@ -175,46 +132,4 @@ private Map<String, Object> parseArgumentsRun(final String... args) {
175132
return null;
176133
}
177134

178-
private Map<String, Object> parseArgumentsInstall(final String... args) {
179-
if (args.length > 0) {
180-
try {
181-
182-
Options options = new Options();
183-
options.addOption("pythonBinaryPath", true, "Python Binary Path");
184-
options.addOption("verbose", true, "Verbose Mode");
185-
options.addOption("classpath", true, "Additional JAVA classpath ?");
186-
options.addOption("javaBinaryPath", true, "Java Binary Path");
187-
188-
CommandLineParser parser = new DefaultParser();
189-
CommandLine cmd = parser.parse(options, args);
190-
191-
Map<String, Object> parameters = new HashMap<>();
192-
193-
parameters.put("pythonBinaryPath", cmd.getOptionValue("pythonBinaryPath"));
194-
195-
parameters.put("logLevel", cmd.getOptionValue("verbose"));
196-
197-
if (cmd.getOptionValue("classpath") != null) {
198-
parameters.put("classpath", cmd.getOptionValue("classpath"));
199-
} else {
200-
parameters.put("classpath", null);
201-
}
202-
203-
if (cmd.getOptionValue("javaBinaryPath") != null) {
204-
parameters.put("javaBinaryPath", cmd.getOptionValue("javaBinaryPath"));
205-
} else {
206-
parameters.put("javaBinaryPath", null);
207-
}
208-
209-
return parameters;
210-
211-
} catch (ParseException ex) {
212-
log.error("Error parsing arguments : " + ex.toString());
213-
}
214-
} else {
215-
log.error("No parameters passed to the Scijava kernel.");
216-
}
217-
return null;
218-
}
219-
220135
}

src/main/java/org/scijava/jupyter/service/JupyterService.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,6 @@
3131
*/
3232
public interface JupyterService extends SciJavaService {
3333

34-
/* Install kernel */
35-
void installKernel(String... args);
36-
37-
void installKernel(String logLevel, String pythonBinaryPath);
38-
39-
void installKernel(String logLevel, Path pythonBinaryPath);
40-
41-
void installKernel(String logLevel, File pythonBinaryPath);
42-
43-
void installKernel(String logLevel, String pythonBinaryPath, String classpath, String javaBinaryPath);
44-
45-
void installKernel(String logLevel, File pythonBinaryPath, String classpath, String javaBinaryPath);
46-
4734
/* Run kernel */
4835
void runKernel(String... args);
4936

teaser.gif

-1.69 MB
Binary file not shown.

0 commit comments

Comments
 (0)