Coder Social home page Coder Social logo

Comments (6)

jkhsjdhjs avatar jkhsjdhjs commented on September 25, 2024 2

@Steinmautz89 Thanks for reporting this! #50 should fix this issue.

from basyx-python-sdk.

jkhsjdhjs avatar jkhsjdhjs commented on September 25, 2024

Can't reproduce:

>>> from basyx.aas import model
>>> model.Property("abc", model.datatypes.Int, 0).value
0
>>> model.Property("abc", model.datatypes.Int, "0").value
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jkhsjdhjs/git/basyx-python-sdk/basyx/aas/model/submodel.py", line 189, in __init__
    self._value: Optional[base.ValueDataType] = (datatypes.trivial_cast(value, value_type)
  File "/home/jkhsjdhjs/git/basyx-python-sdk/basyx/aas/model/datatypes.py", line 424, in trivial_cast
    raise TypeError("{} cannot be trivially casted into {}".format(repr(value), type_.__name__))
TypeError: '0' cannot be trivially casted into Int

Can you give a description on how to reproduce this issue?

from basyx-python-sdk.

Steinmautz89 avatar Steinmautz89 commented on September 25, 2024

Actually it occurs when AASXWriter is used.

image

from basyx-python-sdk.

s-heppner avatar s-heppner commented on September 25, 2024

This could be a limitation of the serialization. Could you verify if the aas file inside the .aasx zip package is a JSON or an XML file?

from basyx-python-sdk.

Steinmautz89 avatar Steinmautz89 commented on September 25, 2024

It is an XML file.

from basyx-python-sdk.

s-heppner avatar s-heppner commented on September 25, 2024

@jkhsjdhjs could you take a look at how the XML adapter serializes and deserializes 0?

from basyx-python-sdk.

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.