NRL-Plasma-Physics-Division / turbopy

A lightweight computational physics framework, based on the organization of turboWAVE. Implements a "Simulation, PhysicsModule, ComputeTool, Diagnostic" class hierarchy.
https://turbopy.readthedocs.io/
Creative Commons Zero v1.0 Universal
10 stars 18 forks source link

Fix default sharing name #147

Closed arichar6 closed 4 years ago

arichar6 commented 4 years ago

Public attributes of custom PhysicsModules are shared using a key <class name>_<attribute name>. See this line: https://github.com/NRL-Plasma-Physics-Division/turbopy/blob/165a006ad9ea776e775ef5d823791549b7a53ca5/turbopy/core.py#L434

However, this is using self.__class__, which gives a key like <class 'ModuleName'>, resulting in shared keys like <class 'ModuleName'>_attribute_name.

I think that this should instead use self.__class__.__name__, which should give keys like ModuleName_attribute_name.

arichar6 commented 4 years ago

Fixed in #151