Skip to content

Commit

Permalink
Rename Optuna.Storage.IStorage to IOptunaStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
NATSUME Hiroaki committed Feb 20, 2024
1 parent 100efb0 commit c674cfe
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Optuna.Storage
{
public interface IStorage
public interface IOptunaStorage
{
// Basic study manipulation
int CreateNewStudy(StudyDirection[] studyDirections, string studyName);
Expand Down
2 changes: 1 addition & 1 deletion Optuna/Storage/Journal/Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Optuna.Storage.Journal
{
public class JournalStorage : IStorage
public class JournalStorage : IOptunaStorage
{
private readonly Dictionary<int, Study.Study> _studies = new Dictionary<int, Study.Study>();
private int _nextStudyId;
Expand Down
2 changes: 1 addition & 1 deletion Optuna/Storage/RDB/Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Optuna.Storage.RDB
{
public class SqliteStorage : IStorage
public class SqliteStorage : IOptunaStorage
{
private readonly Dictionary<int, Study.Study> _studies = new Dictionary<int, Study.Study>();
private readonly SQLiteConnectionStringBuilder _sqliteConnection;
Expand Down
6 changes: 3 additions & 3 deletions Optuna/Study/Study.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion OptunaTests/Storage/StorageSameBevaviorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion Tunny.Core/Settings/Storage.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.IO;

using Optuna.Storage;
using Optuna.Study;

using Python.Runtime;
Expand Down Expand Up @@ -131,7 +132,7 @@ private dynamic CreateArtifactBackendProcess()
public Study[] GetAllStudies()
{
TLog.MethodStart();
Optuna.Storage.IStorage storage;
IOptunaStorage storage;
switch (Type)
{
case StorageType.Sqlite:
Expand Down

0 comments on commit c674cfe

Please sign in to comment.