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

AttributeError: 'Timedelta' object has no attribute 'astype' #49

Closed
muschellij2 opened this issue Jan 4, 2024 · 1 comment · Fixed by #50
Closed

AttributeError: 'Timedelta' object has no attribute 'astype' #49

muschellij2 opened this issue Jan 4, 2024 · 1 comment · Fixed by #50

Comments

@muschellij2
Copy link
Contributor

Description

Failure in actipy.process command when estiamting non-wear periods on line

data, info = actipy.process(

This is due to a failure of detect_nonwear
detect_nonwear=True,

File to Reproduce

P30_wrist100.csv.gz
This is from https://ora.ox.ac.uk/objects/uuid:19d3cb34-e2b3-4177-91b6-1bad0e0163e7.

$ conda activate stepcount
(stepcount) $ stepcount P30_wrist100.csv.gz 

And the resulting output is:

actipy/processing.py:294: UserWarning: Skipping calibration: Insufficient stationary samples: 1 < 50
  warnings.warn(f"Skipping calibration: Insufficient stationary samples: {len(xyz)} < {calib_min_samples}")
Gravity calibration... Done! (0.04s)
Traceback (most recent call last):
  File "/Users/johnmuschelli/miniconda3/envs/stepcount/bin/stepcount", line 8, in <module>
    sys.exit(main())
  File "/Users/johnmuschelli/miniconda3/envs/stepcount/lib/python3.9/site-packages/stepcount/stepcount.py", line 48, in main
    data, info = read(args.filepath, resample_hz, verbose=verbose)
  File "/Users/johnmuschelli/miniconda3/envs/stepcount/lib/python3.9/site-packages/stepcount/stepcount.py", line 356, in read
    data, info = actipy.process(
  File "/Users/johnmuschelli/miniconda3/envs/stepcount/lib/python3.9/site-packages/actipy/reader.py", line 144, in process
    data, info_nonwear = P.detect_nonwear(data)
  File "/Users/johnmuschelli/miniconda3/envs/stepcount/lib/python3.9/site-packages/actipy/processing.py", line 201, in detect_nonwear
    stationary_segment_ids
AttributeError: 'Timedelta' object has no attribute 'astype'
@muschellij2
Copy link
Contributor Author

Upgrading to actipy 3.0.5 resolved this issue - likely should make this a higher req?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant