Skip to content

Commit

Permalink
make key methods private to avoid modification of engieninfo objects
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Aug 30, 2023
1 parent 5c2c3ac commit c3d6cd4
Showing 1 changed file with 2 additions and 37 deletions.
39 changes: 2 additions & 37 deletions src/main/java/io/bioimage/modelrunner/engine/EngineInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -867,29 +867,6 @@ public String getDeepLearningVersionJarsDirectory()
return this.jarsDirectory + File.separator + vv;
}

/**
* Set whether the engine supports GPU or not. Does not support GPU by
* default.
*
* @param support
* true if it supports GPU and false otherwise
*/
public void supportGPU( boolean support )
{
gpu = support;
}

/**
* Set whether the engine supports CPU or not. By default supports CPU
*
* @param support
* true if it supports CPU and false otherwise
*/
public void supportCPU( boolean support )
{
cpu = support;
}

/**
* Finds the version of Deep Learning framework (engine) equivalent or
* compatible with the one used to train the model. This is done because
Expand Down Expand Up @@ -927,7 +904,7 @@ public String getEngine()
* @param engine
* Deep Learning framework used for the model
*/
public void setEngine( String engine )
private void setEngine( String engine )
{
if ( engine.contentEquals( ModelWeight.getTensorflowID() ) )
this.engine = TENSORFLOW_ENGINE_NAME;
Expand All @@ -937,18 +914,6 @@ else if ( engine.contentEquals( ModelWeight.getOnnxID() ) )
this.engine = ONNX_ENGINE_NAME;
}

/**
* Set the directory where the program will look for the Deep Learning
* framework jars See {@link #jarsDirectory} for more explanation
*
* @param jarsDirectory
* directory where all the folders containing the JARs are stored
*/
public void setJarsDirectory( String jarsDirectory )
{
this.jarsDirectory = jarsDirectory;
}

/**
* Return the String path to the directory where all the jars to load a Deep
* Learning framework (engine) are stored. See {@link #jarsDirectory} for
Expand Down Expand Up @@ -1136,7 +1101,7 @@ public String getMajorVersion()
* object is
* @return true if the engine is installed and false otherwise
*/
public boolean isEngineInstalled() {
private boolean isEngineInstalled() {
File file = new File(this.getDeepLearningVersionJarsDirectory());
try {
boolean missingJars = (DeepLearningVersion.fromFile(file).checkMissingJars().size() == 0);
Expand Down

0 comments on commit c3d6cd4

Please sign in to comment.