Skip to content

Commit

Permalink
Allow loading of fully initialized config from jupyter notbooks
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Sep 13, 2019
1 parent f163240 commit a5f3b68
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion freqtrade/configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,16 @@ def from_files(files: List[str]) -> Dict[str, Any]:
and merging their contents.
Files are loaded in sequence, parameters in later configuration files
override the same parameter from an earlier file (last definition wins).
Runs through the whole Configuration initialization, so all expected config entries
are available to interactive environments.
:param files: List of file paths
:return: configuration dictionary
"""
c = Configuration({"config": files}, RunMode.OTHER)
return c.get_config()

def load_from_files(self, files: List[str]) -> Dict[str, Any]:

# Keep this method as staticmethod, so it can be used from interactive environments
config: Dict[str, Any] = {}

Expand Down Expand Up @@ -81,7 +88,7 @@ def load_config(self) -> Dict[str, Any]:
:return: Configuration dictionary
"""
# Load all configs
config: Dict[str, Any] = Configuration.from_files(self.args["config"])
config: Dict[str, Any] = self.load_from_files(self.args["config"])

self._process_common_options(config)

Expand Down

0 comments on commit a5f3b68

Please sign in to comment.