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

basin3d_plugin_access decorator bug #170

Open
dschristianson opened this issue Jul 20, 2023 · 0 comments
Open

basin3d_plugin_access decorator bug #170

dschristianson opened this issue Jul 20, 2023 · 0 comments
Labels
BASIN-3D bug Something isn't working

Comments

@dschristianson
Copy link
Contributor

The alpha plugin using the decorator basin3d_plugin_access (core/plugin.py) is not passing the instantiated model access class when accessing a method.

In a MonitoringFeatureAccess get method, self.datasource shows up as a property not a datasource.
I.e., stepping into line 296 in core/synthesis.py

  • prior to stepping in and even evaluating the specified plugin_view, self.datasource has a DataSource type assigned as expected.
  • once into the plugin's MonitoringFeature get method, self.datasource is property type that looks to be not instantiated. It seems to the the class definition as seen in the plugin_access_classes list.

Note:

  • DataSourcePluginPoint.init (in core/plugin.py) appears to be called and self.access_classes dictionary set up properly.
  • items in the plugin_access_classes list, which is set up in the decorator, remain class definitions as expected.
  • Plugins using traditional class structures work fine (e.g., PluginModelAccess class with list and get methods).

To Reproduce
The issue was found during updates to properly use the retrieve method in DataSourceModelAccess. The following is not tested but is where I would start.

  1. Rework the alpha plugin to use decorator
  2. initiate a DataSynthesizer with the alpha plugin
  3. call the DataSynthesizer.monitoring_features method with QueryMonitoringFeature(id=)

Expected behavior
The decorator should properly mimic traditional access class behavior.

Environment

  • Python 3.9
  • Version 0.4.2 development

Additional Context
For now, we made the basin3d_plugin_access decorator a private class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BASIN-3D bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants