[x3d-public] Errors in serialized X3D Python (my collection)
Brutzman, Donald (Don) (CIV)
brutzman at nps.edu
Thu Apr 11 08:14:43 PDT 2019
Sorry to hear you are getting frustrated. Again apologies that I can't dedicate the same hours as you during the work week, job priorities intervene.
Not sure what the problem is that you are considering.
Early this week I posted a link to log outputs of dual conversions from both "prior" and "future" syntax approaches. These all performed validation, with majority passing. Note that I changed some of the file names of outputs so that we could keep track of inputs and outputs.
Here are build log urls again.
- Note that all three are checked into subversion so that indeed we have a subversion record of current build state.
- Having Java logs as well as python logs lets us discriminate pure java errors from python errors.
- Version control history also allows us to back track, determining when errors creep in or get fixed.
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/build.java.all.log.txt
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/build.json.all.log.txt
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/build.python.all.log.txt
Note that the ant build script for each example archive renames outputs. Excerpt follows, examples attached. These are all the same as the other night, subversion timestamps show that I haven't tried any further refinements.
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/build.xml
<target name="processScenes.python" description="generate python source, run validation test" depends="">
<echo message="$env.JAVA_HOME=${env.JAVA_HOME}"/>
<echo message="$env.CLASSPATH=${env.CLASSPATH}"/>
<echo message="$pyjnius.X3DautoclassPath =${pyjnius.X3DautoclassPath}"/>
<echo message="PYTHONPATH =${pyjnius.X3DautoclassPath}"/>
<echo message="$pyjnius.configurationPath=${pyjnius.configurationPath}"/>
<echo message="Verifying Apache Ant XML Catalog resolver classpath: ${resolver.dir}/resolver.jar (${resolver.jar.length} bytes)"/>
<echo message="====================="/>
<for param="file.path.name">
<path>
<fileset refid="x3dScenes"/>
</path>
<sequential>
<propertyregex
property="name.short"
override="true"
input="@{file.path.name}"
regexp="([^\n]*)[\\/]([^\n]*)\.x3d"
select="\2"/>
<propertyregex
property="relative.path1"
override="true"
input="@{file.path.name}"
regexp="([^\n]*)X3dForWebAuthors[\\/]([^\n^\\^/]*)[\\/]([^\n]*)\.x3d"
select="\2"/>
<propertyregex
property="relative.path2"
override="true"
input="@{file.path.name}"
regexp="()()()"
select="\3"/>
<!-- trace
<echo></echo>
<echo>@file.path.name = @{file.path.name}</echo>
<echo>$archive.path = ${archive.path}</echo>
<echo>$relative.path1 = ${relative.path1}</echo>
<echo>$relative.path2 = ${relative.path2}</echo>
<echo>$name.short = ${name.short}</echo>
-->
<outofdate>
<sourcefiles>
<filelist>
<file name="@{file.path.name}"/>
</filelist>
</sourcefiles>
<mapper dir="." type="glob" from="*.x3d" to="*.py"/>
<!--<mapper dir="." type="glob" from="*.x3d" to="*.future.py"/>-->
<sequential>
<!-- process individual files here. show full path to facilitate user loading, editing of reported files -->
<!-- see stylesheets/java/src/python/pyjnius/build.xml -->
<echo message="create python:"/>
<echo message="node xml2all.js ${archive.path}/${relative.path1}/${relative.path2}/${name.short}.x3d"/>
<exec executable="node" vmlauncher="false"><!-- vmlauncher switch needed for netbeans invocation -->
<arg value="${pyjnius.X3DautoclassPath}/xml2all.js"/>
<arg value="${archive.path}/${relative.path1}/${relative.path2}/${name.short}.x3d"/>
</exec>
<!-- TODO verify result -->
<echo>${name.short}.x3d converted to ${name.short}.py</echo>
<!-- now run python output to validate -->
<echo message="- - - - - - - - - - -"/>
<echo message="validate python:"/>
<if>
<!-- https://ant.apache.org/manual/Tasks/conditions.html -->
<contains string="${name.short}" substring="{name.short}" /><!-- undefined -->
<then>
<echo message="filename not found"/> <!-- in order to get a filename -->
</then>
<else>
<!-- https://ant.apache.org/manual-1.9.x/Tasks/exec.html Examples -->
<!-- https://stackoverflow.com/questions/5607580/how-to-set-the-path-environment-variable-from-ant-script -->
<echo message="Loading ${name.short}.py with X3DJSAIL, if successful then saving as round-trip ${name.short}_RoundTrip1.x3d version:"/>
<exec executable="python" dir="${pyjnius.X3DautoclassPath}" vmlauncher="false">
<env key="Path" path="${pyjnius.configurationPath}"/>
<env key="PYTHONPATH" path="${pyjnius.X3DautoclassPath}"/>
<arg value="${archive.path}/${relative.path1}/${relative.path2}/${name.short}.py"/>
<arg value="-v"/><!-- verbose -->
</exec>
<move file="${archive.path}/${relative.path1}/${relative.path2}/${name.short}_RoundTrip.x3d" quiet="true" failonerror="false" verbose="false"
tofile="${archive.path}/${relative.path1}/${relative.path2}/${name.short}_RoundTrip1.x3d"/>
<!-- immutable <length property="RoundTrip1.length" file="${archive.path}/${relative.path1}/${relative.path2}/${name.short}_RoundTrip1.x3d"/> -->
<echo message="${name.short}.py round-trip load test #1 complete"/>
<echo message="- - - - - -"/>
<echo message="Loading ${name.short}.future.py with X3DJSAIL, if successful then saving as round-trip ${name.short}_RoundTrip2.x3d version:"/>
<exec executable="python" dir="${pyjnius.X3DautoclassPath}" vmlauncher="false">
<env key="Path" path="${pyjnius.configurationPath}"/>
<env key="PYTHONPATH" path="${pyjnius.X3DautoclassPath}"/>
<arg value="${archive.path}/${relative.path1}/${relative.path2}/${name.short}.future.py"/>
<arg value="-v"/><!-- verbose -->
</exec>
<move file="${archive.path}/${relative.path1}/${relative.path2}/${name.short}_RoundTrip.x3d" quiet="true" failonerror="false" verbose="false"
tofile="${archive.path}/${relative.path1}/${relative.path2}/${name.short}_RoundTrip1.x3d"/>
<echo message="${name.short}.future.py round-trip load test #2 complete"/>
<echo message="====================="/>
</else>
</if>
</sequential>
</outofdate>
</sequential>
</for>
<antcall target="echo.timestamp"/>
<echo>processScenes.python complete.</echo>
<!-- <antcall target="processScenes.javadoc"/> -->
</target>
Note that the .py filenames are unchanged, but the post-serialization .x3d filenames now include "_RoundTrip#.x3d" for disambiguation from original .x3d and each other.
Aha, am seeing an error, second output got copied over *_RoundTrip1.x3d instead of *_RoundTrip2.x3d as intended. Corrections attached, will rerun full set when able. Current excerpt of build log follows. You are right, all of the *.future.py conversions to *_RoundTrip2.x3d are failing because of the abstract interface error.
=====================
create python:
node xml2all.js C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors/Chapter01TechnicalOverview//HelloWorld.x3d
HelloWorld.x3d converted to HelloWorld.py
- - - - - - - - - - -
validate python:
Loading HelloWorld.py with X3DJSAIL, if successful then saving as round-trip HelloWorld_RoundTrip1.x3d version:
Moving 1 file to C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors\Chapter01TechnicalOverview
HelloWorld.py round-trip load test #1 complete
- - - - - -
Loading HelloWorld.future.py with X3DJSAIL, if successful then saving as round-trip HelloWorld_RoundTrip2.x3d version:
Traceback (most recent call last):
File "C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors/Chapter01TechnicalOverview//HelloWorld.future.py", line 104, in <module>
.setDEF("ViewUpClose") \
AttributeError: 'org.web3d.x3d.sai.Navigation.X3DViewpointNode' object has no attribute 'setCenterOfRotation'
Result: 1
HelloWorld.future.py round-trip load test #2 complete
=====================
Apologies if I broke any of your tests. Before I checked in, I always try to ensure WORKSFORME beforehand. As agreed upon, I have stayed within the pyjnius directory.
Hopefully this helps.
On 4/10/2019 1:57 PM, John Carlson wrote:
> No, it’s not okay to keep *.future.py files unless we are willing to make the changes to X3DJSAIL/PyJNIus/Python/Java to make them work (fix some examples to make them work, like abox.future.py). They are not working on my system (no output)!
>
> But I can’t tell, because of a smokescreen that someone created in my python serializers to generate identical filenames!
>
> Do I need to go through svn logs?
>
> Perhaps I should send you some python files that don’t work? Would that be better?
>
> Dang, missed my coffee today. Maybe later.
>
> John
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
>
> *From: *Brutzman, Donald (Don) (CIV) <mailto:brutzman at nps.edu>
> *Sent: *Tuesday, April 9, 2019 11:20 PM
> *To: *John Carlson <mailto:yottzumm at gmail.com>
> *Cc: *X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *Subject: *Re: Errors in serialized X3D Python (my collection)
>
> Thanks for activity John. We have a big research event going on this week at NPS that is preventing my from keeping pace - will catch up when possible.
>
> It is OK to keep the .future.py files active, the build scripts for X3D Examples Archives are tuned to the filenames. Since they showed differences, recommend the checked-in version continue with both conversions since that aids in debugging.
>
> On 4/9/2019 8:43 PM, John Carlson wrote:
>
> > There were some errors on collision objects using setProxy when they shouldn’t be.
>
> >
>
> > These are caused because proxy is after children in mapToMethod.js.
>
> >
>
> > We can override in mapToMethod2.js I think.
>
> >
>
> > I did that.
>
> >
>
> > I have stopped running *.future.py files in pyjnius/build.xml To add back, remove future.py line.
>
> >
>
> > Fixed MFBool arrays, checking now.
>
> >
>
> > John
>
> >
>
> all the best, Don
>
> --
>
> Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
>
> Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
>
> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
>
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HelloWorld.x3d
Type: model/x3d+xml
Size: 3386 bytes
Desc: HelloWorld.x3d
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190411/eccfdcc1/attachment-0002.x3d>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: HelloWorld.py
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190411/eccfdcc1/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: HelloWorld.future.py
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190411/eccfdcc1/attachment-0003.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HelloWorld_RoundTrip1.x3d
Type: model/x3d+xml
Size: 3193 bytes
Desc: HelloWorld_RoundTrip1.x3d
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190411/eccfdcc1/attachment-0003.x3d>
More information about the x3d-public
mailing list