Skip to content

TwoPhotonSession has static fields #10

@mitlabence

Description

@mitlabence

At the time of writing the code, I was unaware that in Python, there is no static keyword, and object-specific attributes should be defined in init. All the attributes used are now defined outside init, which is the way to do it in many languages, but not python, as in this case, these attributes become static, i.e. class-bound, not instance-bound. In other words, defining a second instance of the class will overwrite these attributes (or cause weird behaviour like the number of frames is stored from the previous instance) also for the first instance, as the attributes are shared in all instances of the class.
I have observed this and thought it a bug at first, which led me to add the dirty_close() function, which solves the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions