Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Jun 6, 2024
1 parent 775c836 commit 4eb8147
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions internal/registry/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ type Factory struct {
interruptible bool
}

// Session is the session definition according to this package.
type Session = model.ExperimentTargetLoaderSession

// NewTargetLoader creates a new [model.ExperimentTargetLoader] instance.
func (b *Factory) NewTargetLoader(config *model.ExperimentTargetLoaderConfig) model.ExperimentTargetLoader {
return &targetloading.Loader{
CheckInConfig: config.CheckInConfig, // OPTIONAL
ExperimentName: b.canonicalName,
InputPolicy: b.inputPolicy,
Logger: config.Session.Logger(),
Session: config.Session,
StaticInputs: config.StaticInputs,
SourceFiles: config.SourceFiles,
}
}

// Interruptible returns whether the experiment is interruptible.
func (b *Factory) Interruptible() bool {
return b.interruptible
Expand Down Expand Up @@ -222,22 +238,6 @@ func (b *Factory) NewExperimentMeasurer() model.ExperimentMeasurer {
return b.build(b.config)
}

// Session is the session definition according to this package.
type Session = model.ExperimentTargetLoaderSession

// NewTargetLoader creates a new [model.ExperimentTargetLoader] instance.
func (b *Factory) NewTargetLoader(config *model.ExperimentTargetLoaderConfig) model.ExperimentTargetLoader {
return &targetloading.Loader{
CheckInConfig: config.CheckInConfig, // OPTIONAL
ExperimentName: b.canonicalName,
InputPolicy: b.inputPolicy,
Logger: config.Session.Logger(),
Session: config.Session,
StaticInputs: config.StaticInputs,
SourceFiles: config.SourceFiles,
}
}

// ErrNoSuchExperiment indicates a given experiment does not exist.
var ErrNoSuchExperiment = errors.New("no such experiment")

Expand Down

0 comments on commit 4eb8147

Please sign in to comment.