ium/IUM_07/file_observer.py

19 lines
463 B
Python
Raw Normal View History

2021-04-26 11:44:34 +02:00
from sacred.observers import FileStorageObserver
from sacred import Experiment
ex = Experiment("file_observer")
ex.observers.append(FileStorageObserver('my_runs'))
@ex.config
def my_config():
recipient = "Świecie"
greeting = "Witaj"
@ex.capture
def prepare_message(recipient, greeting):
return "{0} {1}!".format(greeting, recipient)
@ex.automain
def my_main(recipient, greeting):
print(prepare_message()) ## Nie musimy przekazywać wartości