Coder Social home page Coder Social logo

Comments (3)

Hugovdberg avatar Hugovdberg commented on August 12, 2024

There was some discussion about it recently: #628 but I haven't yet had the time to do the explicit casts to the .NET Enums. Why your summary isn't working using pythonnet 2.5 and python 3.9 I don't know, I cannot reproduce that, which version of the SDK is installed on your system? It appears that message comes from the SDK itself and not PIconnect or Pythonnet.

from piconnect.

Notnagel avatar Notnagel commented on August 12, 2024

Thank you for looking into this. I am on OSIsoft(r) AF SDK Version: 2.9.1.8106. In contrast to #628 recorded_value works and only the point summary fails. When I specify a date range explicitly points.summary('01.01.2021 10:00', '01.01.2021 11:00', SummaryType.AVERAGE) it works.

So this is somehow related to the string parsing in time.py in the function to_af_time_range at return AF.Time.AFTimeRange(start_time, end_time)

I checked, the type of '-14h is str

The debugger throws this message

The 'h' token in the string '*-14h' was not expected.
bei OSIsoft.AF.Time.AFTimeSpan.FormatError(String input, String token, Boolean throwErrors, AFTimeSpan& result)
bei OSIsoft.AF.Time.AFTimeSpan.TryParseImpl(String input, Int32 startlocation, IFormatProvider provider, NumberFormatInfo numberFormat, DateTimeFormatInfo dateTimeFormat, Boolean throwErrors, AFTimeSpan& result)
bei OSIsoft.AF.Time.AFTime.TryParseImpl(String input, Nullable1 referenceTime, AFTimeZone timeZone, IFormatProvider provider, Boolean throwErrors, DateTime& result) bei OSIsoft.AF.Time.AFTime.TryParseRetryImpl(String parmName, String input, Nullable1 referenceTime, IFormatProvider provider, Boolean throwErrors, AFTime& result)
bei OSIsoft.AF.Time.AFTimeRange.TryParseImpl(String startTime, String endTime, AFTime referenceTime, IFormatProvider provider, Boolean throwErrors, AFTime& startAFTime, AFTime& endAFTime)
bei OSIsoft.AF.Time.AFTimeRange..ctor(String startTime, String endTime)

I have found a potential workaround which I have not verified by calling return AF.Time.AFTimeRange.Parse(start_time, end_time)

Now my strings parese ok and also passing datetime objects works (still). So this is related to CultureInfo maybe?

from piconnect.

Hugovdberg avatar Hugovdberg commented on August 12, 2024

Version 0.10.x solves this issue. It is available on PyPI, and I'm working to getting it updated on conda-forge as well, but that has a few issues due to changes in importing the SDK that is not available on the conda build servers. Closing this issue for now.

from piconnect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.