Comments (9)
Hi,
Thanks for the bug report. Actually, it seems that I forgot to code the iD
feature in the pyecore metamodel.
The modification is in two step, the first one is to enable the feature decoding by adding L.1198 in pyecore/ecore.py
the missing feature:
EAttribute.iD = EAttribute('iD', EBoolean)
And the second step is to enable the code generator to code this information in the EAttribute
constructor and in the generated code (so in pyecoregen
and the Acceleo generator also) . This modification fairly easy, but I need to write corresponding tests.
I fix all of this asap!
from pyecore.
Thanks for the quick reply! I made the first change you suggested. I didn't exactly follow what the second change was.
However, on rerunning I no longer get the first error ( yay! ), but I do receive another error. I'm not sure if this is related to the first one.
pyecoregen -e schema.ecore -o your_output_path
Traceback (most recent call last):
File "/Users/$USER/miniconda2/envs/python3-env/bin/pyecoregen", line 11, in <module>
sys.exit(main())
File "/Users/$USER/miniconda2/envs/python3-env/lib/python3.6/site-packages/pyecoregen/cli.py", line 12, in main
generate_from_cli(sys.argv[1:]) # nocover
File "/Users/$USER/miniconda2/envs/python3-env/lib/python3.6/site-packages/pyecoregen/cli.py", line 40, in generate_from_cli
model = load_model(parsed_args.ecore_model)
File "/Users/$USER/miniconda2/envs/python3-env/lib/python3.6/site-packages/pyecoregen/cli.py", line 59, in load_model
resource = rset.get_resource(pyecore.resources.URI(ecore_model_path))
File "/Users/$USER/miniconda2/envs/python3-env/lib/python3.6/site-packages/pyecore/resources/resource.py", line 41, in get_resource
resource.load()
File "/Users/$USER/miniconda2/envs/python3-env/lib/python3.6/site-packages/pyecore/resources/xmi.py", line 39, in load
self._decode_ereferences()
File "/Users/$USER/miniconda2/envs/python3-env/lib/python3.6/site-packages/pyecore/resources/xmi.py", line 233, in _decode_ereferences
.format(value))
ValueError: EObject for ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate is unknown
Do you know what might be going on or how I should proceed?
from pyecore.
Oh, right, it is a missing EDataType
in the pyecore metamodel... I also forgot to add the EDate
datatype. The modification is also quite easy (I will add it right after the iD
feature) in the pyecore/ecore.py
file:
at the import level:
from datetime import datetime
then, L.1167:
EDate = EDataType('EDate', datetime)
then, L.1297:
Core.register_classifier(EDate)
and finally, add EDate
in __all__
, L.1308:
..., 'EDate']
You surely have a great metamodel to deal with all the missing feature! I'm adding the type right away.
from pyecore.
I added the missing iD
feature and EDate
on the devrop
branch. I also modified the Acceleo generator to deal with the iD
feature, you should not be bother with this anymore.
I need to go, but I will adapt the pyecoregen
generator as soon as I can.
from pyecore.
Thanks for the quick fixes! I seem to have found another object that is unknown.
pyecoregen -e schema.ecore -o your_output_path
Traceback (most recent call last):
File "/Users/$USER/miniconda2/envs/python3-env/bin/pyecoregen", line 11, in <module>
sys.exit(main())
File "/Users/$USER/miniconda2/envs/python3-env/lib/python3.6/site-packages/pyecoregen/cli.py", line 12, in main
generate_from_cli(sys.argv[1:]) # nocover
File "/Users/$USER/miniconda2/envs/python3-env/lib/python3.6/site-packages/pyecoregen/cli.py", line 40, in generate_from_cli
model = load_model(parsed_args.ecore_model)
File "/Users/$USER/miniconda2/envs/python3-env/lib/python3.6/site-packages/pyecoregen/cli.py", line 59, in load_model
resource = rset.get_resource(pyecore.resources.URI(ecore_model_path))
File "/Users/$USER/miniconda2/envs/python3-env/lib/python3.6/site-packages/pyecore/resources/resource.py", line 41, in get_resource
resource.load()
File "/Users/$USER/miniconda2/envs/python3-env/lib/python3.6/site-packages/pyecore/resources/xmi.py", line 39, in load
self._decode_ereferences()
File "/Users/$USER/miniconda2/envs/python3-env/lib/python3.6/site-packages/pyecore/resources/xmi.py", line 233, in _decode_ereferences
.format(value))
ValueError: EObject for ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBigDecimal is unknown
from pyecore.
Arf, you're right, this time, this is the EBigDecimal
which is missing. I'm really sorry I forgot so much types... I fix this as soon as I come back home!
from pyecore.
No problem! This is a great package btw :)
from pyecore.
Thanks a lot! I really hope it will be soon 'missing EDataType'-free ;)
So, I finally pushed on develop
the missing EBigDecimal
. By the same occasion, I also pushed some other missing basic EDataType
:
EBigDecimal
EBooleanObject
ELongObject
EByte
EByteObject
EByteArray
EChar
ECharacterObject
EShort
EJavaClass
However, if you use EByte
, EByteObject
or EByteArray
, I'm not sure about the 'serialization' of these EDataType
at the moment (each EDataType
instance can express the way they will be serilized and how they need to be deserialized when they are read from the XMI file, I'm not sure yet the best way to handle them).
I hope this time, all the EDataType
you need are in the pyecore metamodel.
from pyecore.
I've release a new version of PyEcore on pypi (0.5.11) that adds the missing feature for the EAttribute
and the missing EDataTypes
.
Also, there is a new version of pyecoregen on pypi (0.3.0) which deals with the iD
feature generation and prevent Python name clashes.
You can update everything using
$ pip install pyecore pyecoregen -U
from pyecore.
Related Issues (20)
- Problem occured when I using pyecore HOT 1
- Populate classes generated with pyecoregen HOT 5
- Different behavior between generated model and dynamic loaded HOT 6
- EProxy and Hashes HOT 1
- Empty instance list not serialized HOT 9
- AttributeError for EDerivedCollection HOT 2
- EEnum definitions are serialized with the wrong EPackage HOT 10
- Reproducible attribute order HOT 25
- Release a new version HOT 7
- Mixins not working properly HOT 2
- New version breaks serialization of $ref's in pyecoregen-generated metamodel HOT 5
- get all properties of a model element HOT 2
- Diffing Functionality on top of pyecore HOT 1
- BadValueError, str not converted to Integer(int) HOT 1
- Problem resolving the file schema in references HOT 7
- Any validation support? HOT 3
- EOrderedList.clear() does not update references. HOT 3
- Serialize datetime using JsonResource HOT 6
- Left-over instance references after EReference was deleted HOT 1
- XMI Deserialization and serialization mismatch HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyecore.