diff --git a/README.md b/README.md index f741d61c0bc84837226d3cf138e071b51d8d4140..4530b63bc667931fd6c8f05483d994b45f4b9d35 100644 --- a/README.md +++ b/README.md @@ -64,12 +64,21 @@ source ./venv/bin/activate python -m pip install -e . ``` -6. Creat documentation: +6. Create documentation: ``` acc-py init-docs ``` -7. Release product: +7. Check code style using `black`: +``` +python -m pip install black +black --diff . # To see what `black` is proposing to do to your source code +black . # To let `black` edit the source code +``` + +8. Release product: +See acc-py documentation on [wikis](https://wikis.cern.ch/display/ACCPY/Development+HowTo%27s) + ``` acc-py devrelease ``` diff --git a/datascout/__init__.py b/datascout/__init__.py index 442097aea1c9c412686b3eae228b657c138c2fed..89d64b6d9e1501bb796605eecbb838fe41627435 100644 --- a/datascout/__init__.py +++ b/datascout/__init__.py @@ -41,3 +41,6 @@ from ._datascout import parquet_to_awkward # other hidden functions that could be useful for debug from ._datascout import _find_lists from ._datascout import _compare_data + +# saving +from ._datascout import save_dict diff --git a/datascout/_datascout.py b/datascout/_datascout.py index af28cae49e13d528220d4b05ff96f3e12548538d..5e479e351905e462390dd5911d8af6eb72e8df76 100644 --- a/datascout/_datascout.py +++ b/datascout/_datascout.py @@ -348,7 +348,7 @@ def json_to_pandas(filename): """ Function provided for convenience, but not of interest for typical use case... """ - return df.read_json(filename) + return pd.read_json(filename) def pandas_to_dict(input_pandas): @@ -402,14 +402,9 @@ def parquet_to_awkward(filename): ####### Simple save/load functions for the user - -def _getFilename(): - return datetime.now().strftime("%Y.%m.%d.%H.%M.%S.%f") - - def save_dict(dictData, folderPath=None, filename=None, fileFormat="parquet"): if filename == None: - filename = _getFilename() + filename = datetime.now().strftime("%Y.%m.%d.%H.%M.%S.%f") Path(folderPath).mkdir(parents=True, exist_ok=True) filename = os.path.join(folderPath, filename) if fileFormat == "parquet":