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

Ensure "lstm" Folder exists #2913

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update ReadAndSaveModels.java
Sn0w3y authored Dec 6, 2024
commit 2504de3e862047fec1fba578380964dc3957d1de
Original file line number Diff line number Diff line change
@@ -44,18 +44,18 @@
*/
public static void save(HyperParameters hyperParameters) {
String modelName = hyperParameters.getModelName();
String directoryPath = Paths.get(MODEL_DIRECTORY, MODEL_FOLDER) //

Check warning on line 47 in io.openems.edge.predictor.lstm/src/io/openems/edge/predictor/lstm/common/ReadAndSaveModels.java

Codecov / codecov/patch

io.openems.edge.predictor.lstm/src/io/openems/edge/predictor/lstm/common/ReadAndSaveModels.java#L47

Added line #L47 was not covered by tests
.toString();
String filePath = Paths.get(directoryPath, modelName) //
String filePath = Paths.get(directoryPath, modelName)//
.toString();

Check warning on line 50 in io.openems.edge.predictor.lstm/src/io/openems/edge/predictor/lstm/common/ReadAndSaveModels.java

Codecov / codecov/patch

io.openems.edge.predictor.lstm/src/io/openems/edge/predictor/lstm/common/ReadAndSaveModels.java#L49-L50

Added lines #L49 - L50 were not covered by tests

// Ensure the directory exists
File directory = new File(directoryPath);

Check warning on line 53 in io.openems.edge.predictor.lstm/src/io/openems/edge/predictor/lstm/common/ReadAndSaveModels.java

Codecov / codecov/patch

io.openems.edge.predictor.lstm/src/io/openems/edge/predictor/lstm/common/ReadAndSaveModels.java#L53

Added line #L53 was not covered by tests
if (!directory.exists()) {
boolean dirCreated = directory.mkdirs();

Check warning on line 55 in io.openems.edge.predictor.lstm/src/io/openems/edge/predictor/lstm/common/ReadAndSaveModels.java

Codecov / codecov/patch

io.openems.edge.predictor.lstm/src/io/openems/edge/predictor/lstm/common/ReadAndSaveModels.java#L55

Added line #L55 was not covered by tests
if (!dirCreated) {
System.err.println("Failed to create directory: " + directoryPath);
return;

Check warning on line 58 in io.openems.edge.predictor.lstm/src/io/openems/edge/predictor/lstm/common/ReadAndSaveModels.java

Codecov / codecov/patch

io.openems.edge.predictor.lstm/src/io/openems/edge/predictor/lstm/common/ReadAndSaveModels.java#L57-L58

Added lines #L57 - L58 were not covered by tests
}
}