-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added mean temperature and light report at predictions.csv #53
Conversation
It might be a good idea to add an error catch in case columns temperature or light are not present in the raw data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just add the error handling.
# Grouping by time | ||
grouped = data.groupby(pd.Grouper(key='time', freq='30S', origin=data['time'].min())) | ||
# Calculating the mean temperature and light for each group | ||
mean_values = grouped[['temperature', 'light']].mean().iloc[:-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you include an exception handler here to exit the file processing when no temperature or light data is available? No all the devices have these information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also some of the CI testes failed. Would be good if these are also addressed :D
https://github.com/OxWearables/asleep/actions/runs/9999071709/job/27810403819?pr=53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spiousas the CI test still failed though. The formatting should be easy to fix :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry, I missed some fixes. Now it should be OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
I added an optional report of the mean temperature and light for each 30-second interval. This will work only for wearables containing temperature and light data stored in columns named
temperature
andlight
, respectively (for example, Axivity AX3).When adding the parameter
--report_light_and_temp
to theget_sleep
function call, two columns will be added to the predictions.csv file. They contain the mean light and temperature for the interval in the units and scale the wearable provides.Use:
Example output: