diff --git a/Optuna/Storage/IStorage.cs b/Optuna/Storage/IOptunaStorage.cs similarity index 98% rename from Optuna/Storage/IStorage.cs rename to Optuna/Storage/IOptunaStorage.cs index 93ee838b..81cc8ecf 100644 --- a/Optuna/Storage/IStorage.cs +++ b/Optuna/Storage/IOptunaStorage.cs @@ -5,7 +5,7 @@ namespace Optuna.Storage { - public interface IStorage + public interface IOptunaStorage { // Basic study manipulation int CreateNewStudy(StudyDirection[] studyDirections, string studyName); diff --git a/Optuna/Storage/Journal/Storage.cs b/Optuna/Storage/Journal/Storage.cs index d5d4b3b1..65dea23f 100644 --- a/Optuna/Storage/Journal/Storage.cs +++ b/Optuna/Storage/Journal/Storage.cs @@ -10,7 +10,7 @@ namespace Optuna.Storage.Journal { - public class JournalStorage : IStorage + public class JournalStorage : IOptunaStorage { private readonly Dictionary _studies = new Dictionary(); private int _nextStudyId; diff --git a/Optuna/Storage/RDB/Storage.cs b/Optuna/Storage/RDB/Storage.cs index 374f679d..8981592a 100644 --- a/Optuna/Storage/RDB/Storage.cs +++ b/Optuna/Storage/RDB/Storage.cs @@ -12,7 +12,7 @@ namespace Optuna.Storage.RDB { - public class SqliteStorage : IStorage + public class SqliteStorage : IOptunaStorage { private readonly Dictionary _studies = new Dictionary(); private readonly SQLiteConnectionStringBuilder _sqliteConnection; diff --git a/Optuna/Study/Study.cs b/Optuna/Study/Study.cs index 520af27c..f2293749 100644 --- a/Optuna/Study/Study.cs +++ b/Optuna/Study/Study.cs @@ -18,9 +18,9 @@ public class Study public int StudyId { get; } private readonly bool _isMultiObjective; - private readonly IStorage _storage; + private readonly IOptunaStorage _storage; - public Study(IStorage storage, int studyID, string studyName, StudyDirection[] directions) + public Study(IOptunaStorage storage, int studyID, string studyName, StudyDirection[] directions) { StudyId = studyID; _storage = storage; @@ -95,7 +95,7 @@ private Trial.Trial[] GetBestTrials() return MultiObjective.GetParetoFrontTrials(Trials, Directions); } - public static StudySummary[] GetAllStudySummaries(IStorage storage) + public static StudySummary[] GetAllStudySummaries(IOptunaStorage storage) { Study[] studies = storage.GetAllStudies(); var studySummaries = new StudySummary[studies.Length]; diff --git a/OptunaTests/Storage/StorageSameBevaviorTests.cs b/OptunaTests/Storage/StorageSameBevaviorTests.cs index f157255b..dbd79631 100644 --- a/OptunaTests/Storage/StorageSameBevaviorTests.cs +++ b/OptunaTests/Storage/StorageSameBevaviorTests.cs @@ -12,7 +12,7 @@ public class StorageSameBehaviorTests [InlineData(@"TestFile/journal.log", "log")] public void StorageLoadTest(string path, string type) { - IStorage storage; + IOptunaStorage storage; int offset = 0; // journal starts from 0 if (type == "sqlite") diff --git a/Tunny.Core/Settings/Storage.cs b/Tunny.Core/Settings/Storage.cs index 455bc5a7..ea7fece1 100644 --- a/Tunny.Core/Settings/Storage.cs +++ b/Tunny.Core/Settings/Storage.cs @@ -1,6 +1,7 @@ using System; using System.IO; +using Optuna.Storage; using Optuna.Study; using Python.Runtime; @@ -131,7 +132,7 @@ private dynamic CreateArtifactBackendProcess() public Study[] GetAllStudies() { TLog.MethodStart(); - Optuna.Storage.IStorage storage; + IOptunaStorage storage; switch (Type) { case StorageType.Sqlite: