Skip to content

Interval examples throw a dtype warning #347

Description

@colleenjg

Many of the Interval object creation examples in the repo specify start and end as lists of ints, e.g.:

from torch_brain.data import Interval

trials=Interval(
    start=[0, 1, 2],
    end=[1, 2, 3],
    go_cue_time=[0.5, 1.5, 2.5],
    drifting_gratings_dir=[0, 45, 90],
)

As a result, they throw the warning:

WARNING:root:start is of type int64 not of type float64.
WARNING:root:end is of type int64 not of type float64.

Two issues:

  • This occurs in several locations in the repo:
  • What the warning refers to may not be obvious to the user if they are creating a complex object.

Suggested fixes:

  • Update all examples to use start=[0.0, 1.0, 2.0] and end=[1.0, 2.0, 3.0] (except the warning test line specified above).
  • Add a bit of info to the warning (and update what the warning test checks for accordingly):
    logging.warning(f"{name} is of type {value.dtype} not of type float64.") ->
    logging.warning(f"Interval {name} is of type {value.dtype} not of type float64.").

The fixes could be incorporated into the same PR as for #338.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions