Skip to content

Query function in generated python code not handled #376

Open

Description

@Enhaloed

Hi,

I'm currently using the python code generated by using the IFC2X3 schema and noticed that the DERIVE/WHERE statements that use the QUERY function don't appear to be converted properly into python code.

For example, IfcRelAssociatesMaterial has a where statement:

WR21 : SIZEOF(QUERY(temp <* SELF\IfcRelAssociates.RelatedObjects | 
('IFC2X3.IFCFEATUREELEMENTSUBTRACTION' IN TYPEOF(temp))
OR ('IFC2X3.IFCVIRTUALELEMENT' IN TYPEOF(temp))
)) = 0;

The python code generated for this where statement is:

def wr21(self):
	eval_wr21_wr = (SIZEOF(None)  ==  0)
	if not eval_wr21_wr:
		raise AssertionError('Rule wr21 violated')
	else:
		return eval_wr21_wr

Is this the intended behavior?

Thanks for any responses!

Activity

  1. cshorler commented on Apr 19, 2018

    @cshorler
    Member

    No it's not, but many things in the exp2py implementation are not as intended. Changes will be coming soon

  2. Enhaloed commented on Apr 23, 2018

    @Enhaloed
    Author

    Thanks for the info.

    Are there any notable features that have been changed between the last release and the HEAD?

    I'm currently trying to use it to parse ifc files and any extra detail we might be able to get since the last release would be amazing if there is any.

    Thanks again!

  3. cshorler commented on May 20, 2018

    @cshorler
    Member

    I've not compiled the master branch recently, I'll probably start doing that for comparison purposes soon.

    There were some additional changes to exp2py on master since v0.8 (checking the git log)
    https://github.com/stepcode/stepcode/commits?author=cshorler

    All that's on master is near enough all that could be done without more extreme rewrites of exp2py (in my opinion). Some of the fixes were for improving output, I can't recall if the query expression was one of these.

    To this end I'm starting to share some commits on another branch now. The intention of this is for a more fully featured Python implementation. In parallel I'll look for a more practical way to test it, such as a checker tool for STEP files. The initial requirement is to integrate the new lexer/parser - which I'm doing now.

  4. self-assigned this
    on May 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions