We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Not a super important issue, but we get a NotImplementedError when applying units (which are not necessary for the chunk function).
NotImplementedError
chunk
import dascore as dc from dascore.units import s spool = dc.get_example_spool() sub_spool = spool.chunk(time=1*s)
raises:
--------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) Cell In[18], [line 5](vscode-notebook-cell:?execution_count=18&line=5) [2](vscode-notebook-cell:?execution_count=18&line=2) from dascore.units import s [4](vscode-notebook-cell:?execution_count=18&line=4) spool = dc.get_example_spool() ----> [5](vscode-notebook-cell:?execution_count=18&line=5) sub_spool = spool.chunk(time=1*s) File c:\Users\tourei\dasmasw\dasmsw_testing\.venv\lib\site-packages\dascore\core\spool.py:492, in DataFrameSpool.chunk(self, overlap, keep_partial, snap_coords, tolerance, conflict, **kwargs) [482](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/core/spool.py:482) df = self._df.drop(columns=list(self._drop_columns), errors="ignore") [483](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/core/spool.py:483) chunker = ChunkManager( [484](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/core/spool.py:484) overlap=overlap, [485](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/core/spool.py:485) keep_partial=keep_partial, (...) [490](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/core/spool.py:490) **kwargs, [491](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/core/spool.py:491) ) --> [492](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/core/spool.py:492) in_df, out_df = chunker.chunk(df) [493](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/core/spool.py:493) if df.empty: [494](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/core/spool.py:494) instructions = None File c:\Users\tourei\dasmasw\dasmsw_testing\.venv\lib\site-packages\dascore\utils\chunk.py:449, in ChunkManager.chunk(self, df) [447](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/utils/chunk.py:447) group_maxs = stop.groupby(group).max() [448](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/utils/chunk.py:448) # split/group dataframe into new chunks by iterating over each group. --> [449](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/utils/chunk.py:449) out = self._get_group_dfs(group, dur, overlap, group_mins, group_maxs, df, step) [450](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/utils/chunk.py:450) if not len(out): [451](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/utils/chunk.py:451) msg = "Could not chunk. No segments with sufficient length found." ... [171](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/utils/time.py:171) return np.timedelta64("NaT") [172](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/utils/time.py:172) msg = f"type {type(obj)} is not supported" --> [173](file:///C:/Users/tourei/dasmasw/dasmsw_testing/.venv/lib/site-packages/dascore/utils/time.py:173) raise NotImplementedError(msg) NotImplementedError: type <class 'pint.Quantity'> is not supported
The text was updated successfully, but these errors were encountered:
Agreed, we should make this work. We would need to include units in the pytables index, which we don't current do.
Sorry, something went wrong.
No branches or pull requests
Description
Not a super important issue, but we get a
NotImplementedError
when applying units (which are not necessary for thechunk
function).Example
raises:
Expected behavior
Versions
The text was updated successfully, but these errors were encountered: