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

Fix/change studyname error #84

Merged
merged 2 commits into from
Aug 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Please see [here](https://github.com/hrntsm/Tunny/releases) for the data release
### Fixed

- The PythonInstaller window now has no text on the progress bar.
- When more than one Study exists, another Study Name is set and RunOpt no longer causes a Solver Error.

## [0.4.0] -2022-07-09

Expand Down
10 changes: 5 additions & 5 deletions Tunny/Solver/Optuna/Algorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ private static string[] SetDirectionValues(int nObjective)
private bool CheckExistStudyParameter(int nObjective, dynamic optuna)
{
PyList studySummaries = optuna.get_all_study_summaries("sqlite:///" + Settings.Storage);
var directions = new Dictionary<string, int>();
var studySummaryDict = new Dictionary<string, int>();

foreach (dynamic pyObj in studySummaries)
{
directions.Add((string)pyObj.study_name, (int)pyObj.directions.__len__());
studySummaryDict.Add((string)pyObj.study_name, (int)pyObj.directions.__len__());
}

return directions.ContainsKey(Settings.StudyName)
? CheckDirections(nObjective, directions)
: directions.Count == 0;
return studySummaryDict.ContainsKey(Settings.StudyName)
? CheckDirections(nObjective, studySummaryDict)
: studySummaryDict.Count != 0;
}

private bool CheckDirections(int nObjective, Dictionary<string, int> directions)
Expand Down
4 changes: 2 additions & 2 deletions Tunny/Solver/Optuna/Optuna.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ private static void ShowErrorMessages(Exception e)
{
TunnyMessageBox.Show(
"Tunny runtime error:\n" +
"Please send below message (& gh file if possible) to Tunny support.\n\n" +
"If this error occurs, the Tunny solver will not work after this unless Rhino is restarted." +
"Please send below message (& gh file if possible) to Tunny support.\n" +
"If this error occurs, the Tunny solver will not work after this unless Rhino is restarted.\n\n" +
"\" " + e.Message + " \"", "Tunny",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Expand Down