-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from OlofHarrysson/noinherit
Removed the need for inheriting from MasterConfig
- Loading branch information
Showing
8 changed files
with
70 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from anyfig.masterconfig import MasterConfig, save_config, load_config | ||
from anyfig.anyfig_setup import setup_config, parse_args, choose_config, get_available_configs, overwrite, config_class, print_source | ||
from anyfig.anyfig_setup import setup_config, parse_args, choose_config, overwrite, config_class, print_source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,29 @@ | ||
import anyfig | ||
import random | ||
# import otherfile | ||
|
||
|
||
class RandomClass(): | ||
def __init__(self): | ||
self.seed = 0 | ||
self.hej = 'wowowo' | ||
|
||
|
||
@anyfig.config_class | ||
class FooConfig(anyfig.MasterConfig): | ||
class FooConfig2(RandomClass): | ||
def __init__(self): | ||
print("INIT FOOCONFIG") | ||
super().__init__() | ||
# self.frozen = 123 | ||
self.experiment_note = 'Changed some stuff' | ||
self.seed = random.randint(0, 80085) | ||
|
||
def myfunc(self): | ||
pass | ||
|
||
# def __str__(self): | ||
# return 'strannnng' | ||
|
||
|
||
config = anyfig.setup_config(default_config='FooConfig') | ||
print(config) | ||
print(config.seed) # Prints -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import anyfig | ||
|
||
|
||
@anyfig.config_class | ||
class FooConfig2(): | ||
def __init__(self): | ||
self.experiment_note = 'Changed some stuff' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters