Giter VIP home page Giter VIP logo

pyecorecapella's People

Contributors

aranega avatar

Watchers

 avatar

pyecorecapella's Issues

[ImportError] Circular dependencies in __init__ EReference eType initialization

pyecoregen generates initializations of EReference.eType and EReference.eOpposite inside the init.py of each subpackage, which requires a lot of import from other packages, and increase the amount of circular dependencies.

Solution proposed : do those initializations only in the top pyEcoreCapella.init.py module

Implementation:

  • generate all those initializations in an intermediate file (called cross_init.inc) in each package submodule
  • at top level, create a init.inc with the import statements for each packages
  • at top level, create init.py by concatenation of top init.inc and the cross_init.inc of all the packages

attached is the templates (rename txt to tpl in pyecoregen) and the patch for ecore.py

cross_init.inc.tpl
package.py.tpl
ecore.py.patch

[load] Fail to instantiate information.datatype.BooleanType

at line 79 of test.empty.project.melodymodeller, exception in capellacore.GeneralizableElement class, when calling for super().__init__(**kwargs)

Exception: TypeError: 'NoneType' object is not callable

`
76 <ownedDataPkgs xsi:type="org.polarsys.capella.core.data.information:DataPkg"

77 id="66759f08-414c-4fdf-90ba-fc166fe5b60b" name="Predefined Types">

78 <ownedDataTypes xsi:type="org.polarsys.capella.core.data.information.datatype:BooleanType"

79 id="be303636-11ee-4391-a46e-d837086c29e7" name="Boolean" visibility="PUBLIC">

80 <ownedLiterals xsi:type="org.polarsys.capella.core.data.information.datavalue:LiteralBooleanValue"

81 id="4e1cecad-d14a-4930-bc74-85cd6dc918e4" name="True" abstractType="#be303636-11ee-4391-a46e-d837086c29e7"

82 value="true"/>
`

[AttributeError] Some eOpposite initialization fail

some eOpposite initialization fail.

temporary workaround: apply patch https://github.com/cgava/pyEcoreCapella/blob/testing_init_import_star/undefined_eopposite.utf8.patch

Example:
InterfaceAllocator.provisionedInterfaceAllocations.eOpposite = InterfaceAllocation.allocatingInterfaceAllocator

Fail with the following Trace:
Traceback (most recent call last): File "//tests/test.py", line 4, in <module> import pyEcoreCapella as pyEcoreCapella File "//pyEcoreCapella/__init__.py", line 364, in <module> InterfaceAllocator.provisionedInterfaceAllocations.eOpposite = InterfaceAllocation.allocatingInterfaceAllocator File "//pyecore/pyecore/ecore.py", line 766, in eOpposite value._eopposite = self AttributeError: 'property' object has no attribute '_eopposite'

[ImportError] behavior module name conflicts with pyecore.behavior

detected on commit: 68a0370

Traceback (most recent call last):
  File "capella2python/tests/test.py", line 7, in <module>
    import pyEcoreCapella.activity as Activity
  File "capella2python/pyEcoreCapella/activity/__init__.py", line 2, in <module>
    from .activity import getEClassifier, eClassifiers
  File "capella2python/pyEcoreCapella/activity/activity.py", line 7, in <module>
    from behavior import AbstractBehavior
  File "GitWS-Community/pyecore/pyecore/behavior.py", line 36, in <module>
    from . import ecore
ImportError: attempted relative import with no known parent package

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.