Code Monkey home page Code Monkey logo

ethome's People

Contributors

benlansdell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

robjohnson12

ethome's Issues

Rename get sample data paths for consistency

From imcatta JOSS review:

There are two methods to get example data: get_sample_nwb__paths(), which returns NWB data, and get_sample_data_paths(), which returns DLC and BORIS. I suggest renaming the latter to something that recalls DLC and BORIS for consistency.

create_dataset with animal_renamer has to be provided as none

When running create_dataset the animal_renamer has to be provided as None (even though it's the default value) if not being used, otherwise, at least for me it throws an error like a dict was passed instead of the file path. Happens in read_boris_annotation here when loading the BORIS csv file.

More examples

More examples could be provided for different inputs so that the users can quickly navigate or follow an example notebook by just pointing to their directories with data.

Nans from computed speed feature propagate into feature creation

For the speeds feature for all my files first five indices are not calculated - which stems from here where dt = features_df['time'].diff(periods = n_shifts) . Same will happen for compute_part_speed here. Because periods=5 first five indices have nothing to be compared to resulting in NaNs, propagating them further in the feature extraction. Then modelling crashes as there are NaNs in the data.

Update documentation

From imcatta JOSS review:

Documentation

I struggled a little in following the code presented in the README.
    dataset.features.add('cnn1d_prob') If I run this on the nwb example dataset, as suggested above, it tells me that DataFrame doesn't have necessary columns to compute this set of features.. Also, I can’t find which columns are needed. Please consider stating in the documentation what columns are needed and how to get those in the sample dataset.
    cross_val_score(..., dataset.ml.labels, ...). No labels are present in the nwb example dataset, so this is not working with the dataset proposed above.
    Please add package requirements (e.g. Python versions supported) to the README.
    “For this, you must have labeled your body parts in a certain way (refer to How To)”. Please add the link to the How to section.
    Please add a link to the web documentation in the README.
It is stated that “dataset.features.add('cnn1d_prob')Uses a pretrained CNN to output probabilities of 3 behaviors (attack, mount, social investigation).”. More information on this is needed. How was this CNN built? Also, I found out that the repository contains 5 pre-trained models, but no information on that is provided.
Some users may not be fully confident with the DLC, SLEAP, NWB, BORIS and NWB file formats. Please explain the different data input formats supported in more detail.
Guidelines for report issues or problems with the software and seek support are missing.
In How To guide, section “3a In-built support for resident-intruder setup”, more information on what is MARS and context should be provided.

type hints

About the styling, this is rather minor and quickly fixable - in some places type hints are provided in other they are not and in some function definitions arguments are in separate lines while in others they are in one line (as far as I noted these are in the features part of the module).

Fix loading of h5 files

In io.py read_DLC_tracks uses splitext but compares to file extensions without the . hence if statement is never True and cannot load h5 files.

Compatibility with Poetry

Hi! I'm one of the reviewers of your JOSS submission openjournals/joss-reviews#5623.

I noticed that ethome-ml fails to install when using Poetry, a widely used and advanced Python package manager. I do not consider this as acceptance-blocking as the package can be installed successfully using PIP, but I thought you might want to know.

Steps to reproduce

OS: Ubuntu 22.04 (WSL)

$ poetry add ethome-ml
Using version ^0.6.0 for ethome-ml

Updating dependencies
Resolving dependencies... (5.3s)

Package operations: 74 installs, 1 update, 0 removals

  • Installing attrs (23.1.0)
  • Installing rpds-py (0.8.10)
  • Installing six (1.16.0)
  • Installing asttokens (2.2.1)
  • Installing executing (1.2.0)
  • Installing numpy (1.25.1)
  • Installing parso (0.8.3)
  • Installing platformdirs (3.8.1)
  • Installing ptyprocess (0.7.0)
  • Installing pure-eval (0.2.2)
  • Installing referencing (0.29.1)
  • Installing traitlets (5.9.0)
  • Installing wcwidth (0.2.6)
  • Installing backcall (0.2.0)
  • Installing decorator (5.1.1)
  • Installing jedi (0.18.2): Installing...
  • Installing joblib (1.3.1)
  • Installing jsonschema-specifications (2023.6.1)
  • Installing jupyter-core (5.3.1)
  • Installing llvmlite (0.34.0): Preparing...
  • Installing matplotlib-inline (0.1.6)
  • Installing pexpect (4.8.0)
  • Installing pickleshare (0.7.5): Pending...
  • Installing prompt-toolkit (3.0.39): Pending...
  • Installing llvmlite (0.34.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel
  
  running bdist_wheel
  /tmp/tmpp9_iampk/.venv/bin/python /tmp/tmpmpu1hn12/llvmlite-0.34.0/ffi/build.py
  LLVM version... Traceback (most recent call last):
    File "/tmp/tmpmpu1hn12/llvmlite-0.34.0/ffi/build.py", line 105, in main_posix
      out = subprocess.check_output([llvm_config, '--version'])
  • Installing joblib (1.3.1)
  • Installing jsonschema-specifications (2023.6.1)
  • Installing jupyter-core (5.3.1)
  • Installing llvmlite (0.34.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel
  
  running bdist_wheel
  /tmp/tmpp9_iampk/.venv/bin/python /tmp/tmpmpu1hn12/llvmlite-0.34.0/ffi/build.py
  LLVM version... Traceback (most recent call last):
    File "/tmp/tmpmpu1hn12/llvmlite-0.34.0/ffi/build.py", line 105, in main_posix
      out = subprocess.check_output([llvm_config, '--version'])
  • Installing jedi (0.18.2)
  • Installing joblib (1.3.1)
  • Installing jsonschema-specifications (2023.6.1)
  • Installing jupyter-core (5.3.1)
  • Installing llvmlite (0.34.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel
  
  running bdist_wheel
  /tmp/tmpp9_iampk/.venv/bin/python /tmp/tmpmpu1hn12/llvmlite-0.34.0/ffi/build.py
  LLVM version... Traceback (most recent call last):
    File "/tmp/tmpmpu1hn12/llvmlite-0.34.0/ffi/build.py", line 105, in main_posix
      out = subprocess.check_output([llvm_config, '--version'])
    File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    File "/usr/lib/python3.10/subprocess.py", line 501, in run
      with Popen(*popenargs, **kwargs) as process:
    File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/tmp/tmpmpu1hn12/llvmlite-0.34.0/ffi/build.py", line 191, in <module>
      main()
    File "/tmp/tmpmpu1hn12/llvmlite-0.34.0/ffi/build.py", line 181, in main
      main_posix('linux', '.so')
    File "/tmp/tmpmpu1hn12/llvmlite-0.34.0/ffi/build.py", line 107, in main_posix
      raise RuntimeError("%s failed executing, please point LLVM_CONFIG "
  RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config
  error: command '/tmp/tmpp9_iampk/.venv/bin/python' failed with exit code 1
  

  at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/chef.py:147 in _prepare
      143│ 
      144│                 error = ChefBuildError("\n\n".join(message_parts))
      145│ 
      146│             if error is not None:
    → 147│                 raise error from None
      148│ 
      149│             return path
      150│ 
      151│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with llvmlite (0.34.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "llvmlite (==0.34.0)"'.

  • Installing matplotlib-inline (0.1.6)
  • Installing pexpect (4.8.0)
  • Installing pickleshare (0.7.5)
  • Installing prompt-toolkit (3.0.39)
  • Installing pygments (2.15.1)
  • Installing python-dateutil (2.8.2)
  • Installing pytz (2023.3)
  • Installing pyzmq (25.1.0)
  • Installing ruamel-yaml-clib (0.2.7)
  • Installing scipy (1.9.3)
  • Updating setuptools (67.8.0 -> 68.0.0)
  • Installing stack-data (0.6.2)
  • Installing threadpoolctl (3.1.0)
  • Installing tornado (6.3.2)
  • Installing tzdata (2023.3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.