Skip to content

Conversation

@tpaviot
Copy link
Member

@tpaviot tpaviot commented Feb 22, 2012

There were many improvements recently committed, regarding SELECT and ENUMERATION constructed data types. The resolution order issue was also solved. I wish I had more time to review/test what was achieved before releasing, many parts of the code are still missing or partly implemented. Anyway, it can be integrated as is, further developments will come over this first release.

@mpictor
Copy link
Member

mpictor commented Feb 22, 2012

Great! I will test this today, and if all goes well I will merge it and bump the version to 0.5

@tpaviot
Copy link
Member Author

tpaviot commented Feb 22, 2012

You should test that:

  • the branch compiles (it creates a file named fedex_python)
  • the python unittest pass (cd src/fedex_python/python; python SCL_unittest.py). I just realize that one test does not pass because of a method renaming that was not propagated
  • run the script generate_schemas_modules.py from src/fedex_python/examples/unitary_schemas: it creates on python module for each unitary schema. If git status does not report any change, it's ok
  • run the example from the wiki page.

@tpaviot
Copy link
Member Author

tpaviot commented Feb 22, 2012

I recently worked on SELECT type support. You can also check that the following test pass:

$ cd src/fedex_python/examples/unitary_schemas
$ python
> from test_select_data_type import *
> the_glue = glue(STRING("the composition"), STRING("the solvent"))
> wm = wall_mounting(STRING("mounting"), STRING("on"), the_glue)
> print wm

This should not raise any exception.

@tpaviot
Copy link
Member Author

tpaviot commented Feb 22, 2012

I committed 3 more changes. It should be ok now. As soon as this branch is merged, I will create a tp/python-generator-dev-stage2 branch to go on with development. I think I understood how to deal with type checking, aggregates and constructed data types. I have to clean up the current implementation and I will focus on STEP AP.

@mpictor
Copy link
Member

mpictor commented Feb 22, 2012

scl/src/fedex_python/python$ python SCL_unittest.py 
E.......................
======================================================================
ERROR: test_cast_list_to_array (__main__.CastTypeChecker)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "SCL_unittest.py", line 333, in test_cast_list_to_array
    b = cast_python_list_to_aggregate(a,ARRAY(1,3,REAL))
NameError: global name 'cast_python_list_to_aggregate' is not defined

----------------------------------------------------------------------
Ran 24 tests in 0.001s

FAILED (errors=1)

Is that what you meant when you wrote "I just realize that one test does not pass because of a method renaming that was not propagated"?

The rest looks good to me.

In your next branch, what about configuring CMake such that make install calls python setup.py install --home=/path/to/scl-install/? When testing stuff, I like to keep it all on one directory, so I can clean up after myself with rm -rf install/* :)

@tpaviot
Copy link
Member Author

tpaviot commented Feb 23, 2012

@mpictor I removed the buggy test. It is related to a feature that is not completed: type casting from python objects to EXPRESS types. For instance, I'd like to be able to cast floats to REAL, ints to INTEGER type, list to LIST and ARRAY types etc. It's useful when the target type is not known, for instance when creating instances from a p21 file (the Part21 stuff is not finished yet).

@tpaviot
Copy link
Member Author

tpaviot commented Feb 23, 2012

@mpictor I agree with your make install proposal. I would also like to add a feature to fedex_python so that it can generate one python module that does not require any package to be installed (all SCL python code would just be copied at the beginning of the generated module).

mpictor added a commit that referenced this pull request Feb 23, 2012
@mpictor mpictor merged commit d0e2c15 into master Feb 23, 2012
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

Successfully merging this pull request may close these issues.

3 participants