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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* Fixed GenericDataChunkIterator (in hdmf.py) in the case where the number of dimensions is 1 and the size in bytes is greater than the threshold of 1 GB. [PR #638](https://github.com/catalystneuro/neuroconv/pull/638)
* Changed `np.floor` and `np.prod` usage to `math.floor` and `math.prod` in various files. [PR #638](https://github.com/catalystneuro/neuroconv/pull/638)

### Improvements
* Change metadata extraction library from `fparse` to `parse`. [PR #654](https://github.com/catalystneuro/neuroconv/pull/654)

# v0.4.5

### Back-compatibility break
Expand Down
2 changes: 1 addition & 1 deletion requirements-minimal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ psutil>=5.8.0
tqdm>=4.60.0
dandi>=0.57.0
pandas
fparse
parse>=1.20.0
7 changes: 5 additions & 2 deletions src/neuroconv/tools/path_expansion.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Helpful classes for expanding file or folder paths on a system given a f-string rule for matching patterns."""
"""Helpful classes for expanding file or folder paths on a system given an f-string rule for matching patterns."""
import abc
import os
from datetime import date, datetime
from pathlib import Path
from typing import Dict, Iterable, List

from fparse import parse
from parse import parse
from pydantic import DirectoryPath, FilePath

from ..utils import DeepDict
Expand Down Expand Up @@ -81,6 +82,8 @@ def expand_paths(self, source_data_spec: Dict[str, dict]) -> List[DeepDict]:

for meta_key, meta_val in metadata.items():
super_key = standard_metadata.get(meta_key, non_standard_super)
if meta_key == "session_start_time" and isinstance(meta_val, date):
meta_val = datetime(meta_val.year, meta_val.month, meta_val.day)
out[key]["metadata"][super_key][meta_key] = meta_val

return list(dict(out).values())
Expand Down