You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That function was implemented as a bit of a hack to make the tests run correctly. When nose runs, it searches for test modules, imports all of the found modules, and then runs the tests. Registry persists across tests. So, if a test messes with the registry by adding/deleting entries, it must put it back the way it was or clear it before exiting that test module. When import propnet.models or import propnet.symbols is called the first time, this populates the registry (and to your second point, the global namespace). However, calling the import again doesn't do anything because the module is already in the list of imported modules. Hence, to re-import and re-populate the registry with built-in models/symbols, that function is present. I am aware that nose is able to clear the global namespace between test modules with flag --with-isolation, but that breaks test coverage determination.
This is one reason I didn't love the import propnet.models/symbols formalism.
I think it should. Would have to look into it further.
add_builtin_models_to_registry
have to be called?from propnet.symbols.properties import refractive_index
not work ?The text was updated successfully, but these errors were encountered: