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

Consider making certain instance variables read-only properties #38

Open
StokesMIDE opened this issue May 6, 2021 · 0 comments
Open
Labels
API Related to outward-facing package usability fixes/enhancements enhancement New feature or request

Comments

@StokesMIDE
Copy link
Member

Various classes in dataset.py use variables for things that shouldn't be changed by the user; changing them will either have no effect or a bad one. For example, EventArray has .parent, .dataset, .session, .hasSubchannels, .hasMinMeanMax, .allowMeanRemoval, .channelId, .subchannelId, etc. I was going to list everything, but probably the majority of instance variables of classes in dataset.py should be read-only; it would be shorter to list the ones that shouldn't.

In most cases, this would be a matter of something like renaming the variable with an underscore prefix and a property with the old name would just return that. Some internal changes would also be made so the class could access the underscore variable directly, saving an unnecessary function call.

@StokesMIDE StokesMIDE added enhancement New feature or request API Related to outward-facing package usability fixes/enhancements labels May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Related to outward-facing package usability fixes/enhancements enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant