Skip to content
Merged
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
8 changes: 5 additions & 3 deletions pymatbridge/pymatbridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,9 @@ def start(self):
if self.is_connected():
print("%s started and connected!" % self._program_name())
self.set_plot_settings()
return True
return self
else:
print("%s failed to start" % self._program_name())
return False
raise ValueError("%s failed to start" % self._program_name())

def _response(self, **kwargs):
req = json.dumps(kwargs, cls=PymatEncoder)
Expand Down Expand Up @@ -285,6 +284,9 @@ def run_func(self, func_path, *func_args, **kwargs):
-------
Result dictionary with keys: 'message', 'result', and 'success'
"""
if not self.started:
raise ValueError('Session not started, use start()')

nargout = kwargs.pop('nargout', 1)
func_args += tuple(item for pair in zip(kwargs.keys(), kwargs.values())
for item in pair)
Expand Down