Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions swanlab/api/experiment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ def config(self) -> Dict[str, object]:
"""
Experiment configuration. Can be used as filter in the format of 'config.<key>'
"""
return self._data['profile']['config']
return self._data.get('profile', dict()).get('config', dict())

@property
def summary(self) -> Dict[str, object]:
"""
Experiment metrics data. Can be used as filter in the format of 'summary.<key>'
"""
return self._data['profile']['scalar']
return self._data.get('profile', dict()).get('scalar', dict())

@property
def state(self) -> str:
Expand Down Expand Up @@ -115,8 +115,7 @@ def metric_keys(self) -> List[str]:
"""
List of metric keys.
"""
summary_keys = self.summary.keys()
return list(summary_keys)
return list(self.summary.keys())

@property
def history_line_count(self) -> int:
Expand Down
2 changes: 1 addition & 1 deletion swanlab/api/workspace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def profile(self) -> Dict[str, str]:
"""
Workspace profile.
"""
return self._data['profile']
return self._data.get('profile', dict())

@property
def comment(self) -> str:
Expand Down