Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make pandas optional #74

Merged
merged 29 commits into from
Mar 19, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update_with_configs_docstring
avishaihalev committed Mar 19, 2024
commit 1b3c82616d4d744acfec8fae505f78442014bc42
22 changes: 21 additions & 1 deletion src/expfig/fig.py
Original file line number Diff line number Diff line change
@@ -156,11 +156,31 @@ def _create_parser(self, default=None):
return parser

def _create_config_file_parser(self):
parser = argparse.ArgumentParser(prog='GridRLConfig')
parser = argparse.ArgumentParser()
parser.add_argument('--config', default=[], nargs='+', type=ListType(str), action=ListAction)
return parser

def update_with_configs(self, configs, updatee=None):
"""
Update `self` with one or multiple dict-like objects.

Parameters
----------
configs : str, Path, dict or None
One of:
* Path-like pointing to a yaml-file to load a dict from
* dict
* list of the above
* None, in which case no update occurs
updatee : dict-like or None, default None
Object to update. If None, updates self.

Returns
-------
updatee: dict-like
Updated object.

"""
if configs is None:
return self
elif not pd.api.types.is_list_like(configs) or pd.api.types.is_dict_like(configs):