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

Connecting to All Known Data Archive and Asset Framework Servers on Import #722

Open
zslp2 opened this issue Oct 25, 2023 · 3 comments
Open

Comments

@zslp2
Copy link

zslp2 commented Oct 25, 2023

Bug report

Description

On import of PIconnect.PIServer, _lookup_servers() in PIconnect/PI.py and PIconnect/PIAF.py iterate over and connect to each known Data Archive (DA) and Asset Framework (AF) Server respectively. I have +70 known DA servers (most geographically remote, many over a slow data link) and ~50 known AF servers (again most geographically remote, many over a slow data link). This causes package import to take several minutes.

To Reproduce

Steps to reproduce the behavior:

from PIconnect import PIServer

Expected behavior

Package loads without iterating over and connecting to each DA and AF server.

Possible solutions

I am not sure if PIconnect is iterating over and connecting to each DA and AF server for any specific reasons other than to (1) make the connection and (2) list the known databases for each AF server. Even making an automatic connection to the default DA and AF server in _lookup_default_server() is potentially unwanted overhead, since I am always connecting to a specific system through PIServer() or PIAFDatabase().

Since the behavior happens at import, I think the only way to control that behavior is through an environment variable to bypass calls to _lookup_servers() and _lookup_default_server(); however this is only a guess.

System

  • OS: [Windows]
  • Python version: [Python 3.11]
  • PIconnect version: [e.g. 0.10.6]
@tbonewmy
Copy link

tbonewmy commented Nov 7, 2023

Hi @zslp2 , do you know how to get the datatype of a pi point? For example, "numeric type" "non-numeric-type"

@zslp2
Copy link
Author

zslp2 commented Nov 7, 2023 via email

@Hugovdberg
Copy link
Owner

this automatic connection on import seemed to make sense to me when I first developed this package, but is seems to cause more trouble then that it provides convenience. In a future version this is definitely something I want to take out. The more people are using the package, the more assumptions from early development stages are proven incorrect ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants