From david.thompson at kitware.com Tue Jun 2 14:15:05 2015 From: david.thompson at kitware.com (David Thompson) Date: Tue, 2 Jun 2015 14:15:05 -0400 Subject: [Smtk-developers] Dashboard Message-ID: Hi all, The SMTK dashboard is starting to collect a lot of warnings. https://www.kitware.com/CDash/viewBuildError.php?type=1&buildid=559428 While many are from shiboken-generated code (that I am trying to ignore without success), there are also a lot from recent commits ? including the first 50 or so at the link above. Is anyone willing to fix them? David From yumin.yuan at kitware.com Tue Jun 2 14:55:53 2015 From: yumin.yuan at kitware.com (Yumin Yuan) Date: Tue, 2 Jun 2015 14:55:53 -0400 Subject: [Smtk-developers] Dashboard In-Reply-To: References: Message-ID: I will take a look. Yumin On Tue, Jun 2, 2015 at 2:15 PM, David Thompson wrote: > Hi all, > > The SMTK dashboard is starting to collect a lot of warnings. > > https://www.kitware.com/CDash/viewBuildError.php?type=1&buildid=559428 > > While many are from shiboken-generated code (that I am trying to ignore > without success), there are also a lot from recent commits ? including the > first 50 or so at the link above. Is anyone willing to fix them? > > David > _______________________________________________ > Smtk-developers mailing list > Smtk-developers at smtk.org > http://public.kitware.com/mailman/listinfo/smtk-developers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob.obara at kitware.com Wed Jun 3 09:56:57 2015 From: bob.obara at kitware.com (Kitware) Date: Wed, 3 Jun 2015 09:56:57 -0400 Subject: [Smtk-developers] Release 1.0 Message-ID: Hi All, I think we need to reconsider some of the features and issues that are slated for RC2 (aka 1.0) to be moved to a future release. As of now there is now direct funding for general SMTK infrastructure improvements so I think most will have to be back burned for the time being. Which issues do people feel must be addressed for the 1.0 Release (if any). I?ve moved the issues I feel can be postponed. Also - has anyone tried to do an ADH Export process using CMB 4.0? I would like to release SMTK Version 1.0 ideally on Monday unless there are strong objections. Bob Robert M. O'Bara, MEng. Assistant Director of Scientific Computing Kitware Inc. 28 Corporate Drive Suite 101 Clifton Park, NY 12065 Phone: (518) 881- 4931 -------------- next part -------------- An HTML attachment was scrubbed... URL: From yumin.yuan at kitware.com Wed Jun 3 10:46:45 2015 From: yumin.yuan at kitware.com (Yumin Yuan) Date: Wed, 3 Jun 2015 10:46:45 -0400 Subject: [Smtk-developers] Release 1.0 In-Reply-To: References: Message-ID: Hi Bob, On Wed, Jun 3, 2015 at 9:56 AM, Kitware wrote: > Hi All, > > I think we need to reconsider some of the features and issues that are > slated for RC2 (aka 1.0) to be moved to a future release. As of now there > is now direct funding for general SMTK infrastructure improvements so I > think most will have to be back burned for the time being. Which issues do > people feel must be addressed for the 1.0 Release (if any). I?ve moved the > issues I feel can be postponed. > > Also - has anyone tried to do an ADH Export process using CMB 4.0? > > As far as I know, no. I think the template files are still in v1 format (though we can still load them in cmb-4.0), but most importantly the python exporter scripts may need to be modified to match latest smtk. > I would like to release SMTK Version 1.0 ideally on Monday unless there > are strong objections. > > +1. Yumin -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.thompson at kitware.com Wed Jun 3 19:28:10 2015 From: david.thompson at kitware.com (David Thompson) Date: Wed, 3 Jun 2015 19:28:10 -0400 Subject: [Smtk-developers] Python log of operations Message-ID: Hi all, I am working on facilities for logging operations as they occur so that we can replay them later and adapt them in scripted functions. This branch: https://github.com/vibraphone/SMTK/commits/operator-log contains my current work. There are many things not yet handled (especially references to model entities being acted upon) but this Python code self.mgr = smtk.model.Manager.create() sref = self.mgr.createSession('cgm') sref.assignDefaultName() SetActiveSession(sref) # Create a recorder. # It will immediately start logging all operations on the manager # (and only those on the specified model manager). self.recorder = smtk.log.PythonOperatorLog(self.mgr) sph = CreateSphere(radius=1.0, inner_radius=0.2, center=[0.2, 0.2, 0.2]) sph2 = CreateSphere(radius=0.5, center=[0.9, 0., 0.]) su = Union([sph, sph2]) cyl = CreateCylinder(top_radius=1.0) b = CreateBrick(width=2, height=3, depth=5) now generates the log below (which works except for the union operator which has model-entity associations). I hope to make things more compact as well, but the log does currently skip attributes with default values. David from uuid import UUID import smtk from smtk.simple import * mgr = smtk.model.Manager.create() session1 = mgr.createSession('cgm') session1.setName('session 1') # Operator create sphere op1 = session1.op('create sphere') item0 = smtk.attribute.to_concrete(op1.specification().find('center')) SetVectorValue(item0, [0.2, 0.2, 0.2]) item0 = smtk.attribute.to_concrete(op1.specification().find('inner radius')) SetVectorValue(item0, [0.2]) res = op1.operate() # Operator create sphere op2 = session1.op('create sphere') item0 = smtk.attribute.to_concrete(op2.specification().find('center')) SetVectorValue(item0, [0.9, 0.0, 0.0]) item0 = smtk.attribute.to_concrete(op2.specification().find('radius')) SetVectorValue(item0, [0.5]) res = op2.operate() # Operator union op3 = session1.op('union') res = op3.operate() # Operator create cylinder op4 = session1.op('create cylinder') item0 = smtk.attribute.to_concrete(op4.specification().find('major top radius')) SetVectorValue(item0, [1.0]) res = op4.operate() # Operator create brick op5 = session1.op('create brick') item0 = smtk.attribute.to_concrete(op5.specification().find('construction method')) item1 = smtk.attribute.to_concrete(item0.chilrenItems['height']) SetVectorValue(item1, [3.0]) item1 = smtk.attribute.to_concrete(item0.chilrenItems['width']) SetVectorValue(item1, [2.0]) item1 = smtk.attribute.to_concrete(item0.chilrenItems['depth']) SetVectorValue(item1, [5.0]) res = op5.operate() From david.thompson at kitware.com Mon Jun 8 16:17:19 2015 From: david.thompson at kitware.com (David Thompson) Date: Mon, 8 Jun 2015 16:17:19 -0400 Subject: [Smtk-developers] Attribute "paths" Message-ID: Hi all, I don't see a way in SMTK to specify the path to an attribute item; one can ask Attribute::find() to search for a given name but as I understand it, two items are allowed to share the same name as long as they aren't owned by the same parent item. It would be nice to have something like AttributePtr circle; circle->item("construction method/three points/point 1"); // or even: circle->item("construction method/three points/point 1", '/'); Would anyone object to me adding this? I could use it as I develop operator logging. Thanks, David From bob.obara at kitware.com Mon Jun 8 16:41:38 2015 From: bob.obara at kitware.com (Robert Michael O'Bara) Date: Mon, 8 Jun 2015 16:41:38 -0400 Subject: [Smtk-developers] Attribute "paths" In-Reply-To: References: Message-ID: <1D1E318E-E6A7-48CA-BD79-37A74DE3E2BC@kitware.com> Hi David, You can?t add an item whose name already exists in either the attribute definition OR in the definitions its derived from. Bob Robert M. O'Bara, MEng. Assistant Director of Scientific Computing Kitware Inc. 28 Corporate Drive Suite 101 Clifton Park, NY 12065 Phone: (518) 881- 4931 > On Jun 8, 2015, at 4:17 PM, David Thompson wrote: > > Hi all, > > I don't see a way in SMTK to specify the path to an attribute item; one can ask Attribute::find() to search for a given name but as I understand it, two items are allowed to share the same name as long as they aren't owned by the same parent item. > > It would be nice to have something like > > AttributePtr circle; > circle->item("construction method/three points/point 1"); > // or even: > circle->item("construction method/three points/point 1", '/'); > > Would anyone object to me adding this? I could use it as I develop operator logging. > > Thanks, > David > _______________________________________________ > Smtk-developers mailing list > Smtk-developers at smtk.org > http://public.kitware.com/mailman/listinfo/smtk-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.thompson at kitware.com Mon Jun 8 16:49:55 2015 From: david.thompson at kitware.com (David Thompson) Date: Mon, 8 Jun 2015 16:49:55 -0400 Subject: [Smtk-developers] Attribute "paths" In-Reply-To: <1D1E318E-E6A7-48CA-BD79-37A74DE3E2BC@kitware.com> References: <1D1E318E-E6A7-48CA-BD79-37A74DE3E2BC@kitware.com> Message-ID: Hi Bob, > You can?t add an item whose name already exists in either the attribute definition OR in the definitions its derived from. But what about children items (as opposed to inheritance)? Isn't it possible to have a child of item definition A named "foo" and a child of item definition B named "foo", with both A and B belonging to the same attribute? David From bob.obara at kitware.com Mon Jun 8 17:28:35 2015 From: bob.obara at kitware.com (Robert Michael O'Bara) Date: Mon, 8 Jun 2015 17:28:35 -0400 Subject: [Smtk-developers] Attribute "paths" In-Reply-To: References: <1D1E318E-E6A7-48CA-BD79-37A74DE3E2BC@kitware.com> Message-ID: Hi David, You?re right - the child item does seem to violate that rule as well as Group Item Children - so go ahead and put in the new find. Bob Robert M. O'Bara, MEng. Assistant Director of Scientific Computing Kitware Inc. 28 Corporate Drive Suite 101 Clifton Park, NY 12065 Phone: (518) 881- 4931 > On Jun 8, 2015, at 4:49 PM, David Thompson wrote: > > Hi Bob, > >> You can?t add an item whose name already exists in either the attribute definition OR in the definitions its derived from. > > But what about children items (as opposed to inheritance)? Isn't it possible to have a child of item definition A named "foo" and a child of item definition B named "foo", with both A and B belonging to the same attribute? > > David -------------- next part -------------- An HTML attachment was scrubbed... URL: From yumin.yuan at kitware.com Wed Jun 10 00:07:47 2015 From: yumin.yuan at kitware.com (Yumin Yuan) Date: Wed, 10 Jun 2015 00:07:47 -0400 Subject: [Smtk-developers] Inconsistent entity-attribute associations between Attribute and EntityRef Message-ID: Hi Dave and Bob, I noticed some inconsistency between Attribute and EntityRef, in terms of how to manage the associations between entity and attribute. In Attribute class, there is a ModelEntityItem (m_associations) keeping track of the associated entities, and the Attribute::associateEntity() only updates m_associations without updating the Manager (so the manager's association record does not reflect the system), however Attribute::disassociateEntity() will update both m_associations and the Manager. In EntityRef class, the EntityRef::associateAttribute() and EntityRef::disassociateAttribute() depend fully on the Manager to update the associations. I suggest to remove the m_associations from Attribute, and use the Manager instead (like EntityRef) to manage associations. This will avoid keeping the same record in two places and potential mismatch between them. Comments? Yumin -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.thompson at kitware.com Wed Jun 10 07:41:01 2015 From: david.thompson at kitware.com (David Thompson) Date: Wed, 10 Jun 2015 07:41:01 -0400 Subject: [Smtk-developers] Inconsistent entity-attribute associations between Attribute and EntityRef In-Reply-To: References: Message-ID: Hi Yumin, The m_associations member of Attribute was added specifically to make associations accessible in the same way as other Item children of an attribute. It should not be removed because that would require a lot of additional specialized code in the UI layer to present the same type of information as the ModelEntityItem. If there is a bug in the way synchronization between the attribute system and model manager occurs, it should be fixed. David > On Jun 10, 2015, at 00:07, Yumin Yuan wrote: > > Hi Dave and Bob, > > I noticed some inconsistency between Attribute and EntityRef, in terms of how to manage the associations between entity and attribute. > > In Attribute class, there is a ModelEntityItem (m_associations) keeping track of the associated entities, and the Attribute::associateEntity() only updates m_associations without updating the Manager (so the manager's association record does not reflect the system), however Attribute::disassociateEntity() will update both m_associations and the Manager. > > In EntityRef class, the EntityRef::associateAttribute() and EntityRef::disassociateAttribute() depend fully on the Manager to update the associations. > > I suggest to remove the m_associations from Attribute, and use the Manager instead (like EntityRef) to manage associations. This will avoid keeping the same record in two places and potential mismatch between them. > > Comments? > > Yumin From david.thompson at kitware.com Fri Jun 12 11:52:47 2015 From: david.thompson at kitware.com (David Thompson) Date: Fri, 12 Jun 2015 11:52:47 -0400 Subject: [Smtk-developers] Dashboard problems Message-ID: <240C0828-75C4-4FE3-B470-92750C443B85@kitware.com> Hi all, It looks like the CMB superbuild is having some new issues but I don't see any new merges. Does anyone know what's up? The continuous and coverage SMTK builds that use the superbuild Boost and ParaView are complaining that they cannot be found: https://www.kitware.com/CDash/viewConfigure.php?buildid=561280 Thanks, David From Indu.Shukla at erdc.dren.mil Tue Jun 23 15:38:43 2015 From: Indu.Shukla at erdc.dren.mil (Shukla, Indu ERDC-RDE-ITL-MS) Date: Tue, 23 Jun 2015 19:38:43 +0000 Subject: [Smtk-developers] Help Message-ID: SMTK Support, I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format. Since I don?t have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls and their values. Thanks you! Indu Shukla -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ADH_Project_GUI.sbt Type: application/octet-stream Size: 10848 bytes Desc: ADH_Project_GUI.sbt URL: From david.thompson at kitware.com Wed Jun 24 12:10:58 2015 From: david.thompson at kitware.com (David Thompson) Date: Wed, 24 Jun 2015 12:10:58 -0400 Subject: [Smtk-developers] Help In-Reply-To: References: Message-ID: Hi Indu, > I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format. > > Since I don?t have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls and their values. There is a user's guide (with links to reference API documentation) at: http://smtk.readthedocs.org/en/latest/ and in particular, some information about using python: http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/index.html In terms of reading an attribute from an SBT file, this test is an example of how to do so from a Python script, starting at line 55: https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/python/definitionDefaultValueTest.py#L55 and these Python tests are examples of how to access items in the attribute: https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/python/attributeFindItemTest.py https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/python/attributeItemByPath.py Hope this helps, David From Indu.Shukla at erdc.dren.mil Wed Jun 24 14:28:46 2015 From: Indu.Shukla at erdc.dren.mil (Shukla, Indu ERDC-RDE-ITL-MS) Date: Wed, 24 Jun 2015 18:28:46 +0000 Subject: [Smtk-developers] Help In-Reply-To: References: Message-ID: David, Thank you so much for your prompt reply. I have tried using this line of code "asys = smtk.attribute.System()" but I get this error. ''NotImplementedError: 'smtk::attribute::Item' represents a C++ abstract class and cannot be instantiated". Am I missing some library? Indu -----Original Message----- From: David Thompson [mailto:david.thompson at kitware.com] Sent: Wednesday, June 24, 2015 11:11 AM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Indu, > I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format. > > Since I don't have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls and their values. There is a user's guide (with links to reference API documentation) at: http://smtk.readthedocs.org/en/latest/ and in particular, some information about using python: http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/index.html In terms of reading an attribute from an SBT file, this test is an example of how to do so from a Python script, starting at line 55: https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/python/definitionDefaultValueTest.py#L55 and these Python tests are examples of how to access items in the attribute: https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/python/attributeFindItemTest.py https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/python/attributeItemByPath.py Hope this helps, David From david.thompson at kitware.com Wed Jun 24 14:34:20 2015 From: david.thompson at kitware.com (David Thompson) Date: Wed, 24 Jun 2015 14:34:20 -0400 Subject: [Smtk-developers] Help In-Reply-To: References: Message-ID: Hi Indu, The error does not look like a library issue. Library issues would show up when you run "import smtk". The only way it could be a library issue is if you have multiple versions of the same SMTK libraries and are loading in mismatched versions. Are you certain that line is the one causing the problem? If I run import smtk smtk.attribute.Item() I get the error you are reporting (because indeed Item is an abstract class). Does "smtk.attribute.Item()" appear anywhere in your script? David > On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: > > David, > > Thank you so much for your prompt reply. > > I have tried using this line of code "asys = smtk.attribute.System()" but I get this error. > > ''NotImplementedError: 'smtk::attribute::Item' represents a C++ abstract class and cannot be instantiated". Am I missing some library? > > Indu > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > Sent: Wednesday, June 24, 2015 11:11 AM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Indu, > >> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format. >> >> Since I don't have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls and their values. > > There is a user's guide (with links to reference API documentation) at: > > http://smtk.readthedocs.org/en/latest/ > > and in particular, some information about using python: > > http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/index.html > > In terms of reading an attribute from an SBT file, this test is an example of how to do so from a Python script, starting at line 55: > > https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/python/definitionDefaultValueTest.py#L55 > > and these Python tests are examples of how to access items in the attribute: > > https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/python/attributeFindItemTest.py > https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/python/attributeItemByPath.py > > Hope this helps, > David From Indu.Shukla at erdc.dren.mil Wed Jun 24 14:53:07 2015 From: Indu.Shukla at erdc.dren.mil (Shukla, Indu ERDC-RDE-ITL-MS) Date: Wed, 24 Jun 2015 18:53:07 +0000 Subject: [Smtk-developers] Help In-Reply-To: References: Message-ID: David, Yes, I did had smtk.attribute.Item(). But the compiler still doesn't understands that code. It says "Undefined variable from import:System" Thanks, Indu -----Original Message----- From: David Thompson [mailto:david.thompson at kitware.com] Sent: Wednesday, June 24, 2015 1:34 PM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Indu, The error does not look like a library issue. Library issues would show up when you run "import smtk". The only way it could be a library issue is if you have multiple versions of the same SMTK libraries and are loading in mismatched versions. Are you certain that line is the one causing the problem? If I run import smtk smtk.attribute.Item() I get the error you are reporting (because indeed Item is an abstract class). Does "smtk.attribute.Item()" appear anywhere in your script? David > On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: > > David, > > Thank you so much for your prompt reply. > > I have tried using this line of code "asys = smtk.attribute.System()" but I get this error. > > ''NotImplementedError: 'smtk::attribute::Item' represents a C++ abstract class and cannot be instantiated". Am I missing some library? > > Indu > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > Sent: Wednesday, June 24, 2015 11:11 AM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Indu, > >> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format. >> >> Since I don't have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls and their values. > > There is a user's guide (with links to reference API documentation) at: > > http://smtk.readthedocs.org/en/latest/ > > and in particular, some information about using python: > > > http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind > ex.html > > In terms of reading an attribute from an SBT file, this test is an example of how to do so from a Python script, starting at line 55: > > https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt > hon/definitionDefaultValueTest.py#L55 > > and these Python tests are examples of how to access items in the attribute: > > > https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt > hon/attributeFindItemTest.py > https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt > hon/attributeItemByPath.py > > Hope this helps, > David From david.thompson at kitware.com Wed Jun 24 14:54:40 2015 From: david.thompson at kitware.com (David Thompson) Date: Wed, 24 Jun 2015 14:54:40 -0400 Subject: [Smtk-developers] Help In-Reply-To: References: Message-ID: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> Hi Indu, It would help to see the script you are running instead of trying to guess what is happening from an error message. David > On Jun 24, 2015, at 2:53 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: > > David, > > Yes, I did had smtk.attribute.Item(). But the compiler still doesn't understands that code. It says "Undefined variable from import:System" > > Thanks, > > Indu > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > Sent: Wednesday, June 24, 2015 1:34 PM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Indu, > > The error does not look like a library issue. Library issues would show up when you run "import smtk". The only way it could be a library issue is if you have multiple versions of the same SMTK libraries and are loading in mismatched versions. > > Are you certain that line is the one causing the problem? If I run > > import smtk > smtk.attribute.Item() > > I get the error you are reporting (because indeed Item is an abstract class). Does "smtk.attribute.Item()" appear anywhere in your script? > > David > >> On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: >> >> David, >> >> Thank you so much for your prompt reply. >> >> I have tried using this line of code "asys = smtk.attribute.System()" but I get this error. >> >> ''NotImplementedError: 'smtk::attribute::Item' represents a C++ abstract class and cannot be instantiated". Am I missing some library? >> >> Indu >> >> -----Original Message----- >> From: David Thompson [mailto:david.thompson at kitware.com] >> Sent: Wednesday, June 24, 2015 11:11 AM >> To: Shukla, Indu ERDC-RDE-ITL-MS >> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS >> Subject: Re: [Smtk-developers] Help >> >> Hi Indu, >> >>> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format. >>> >>> Since I don't have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls and their values. >> >> There is a user's guide (with links to reference API documentation) at: >> >> http://smtk.readthedocs.org/en/latest/ >> >> and in particular, some information about using python: >> >> >> http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind >> ex.html >> >> In terms of reading an attribute from an SBT file, this test is an example of how to do so from a Python script, starting at line 55: >> >> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >> hon/definitionDefaultValueTest.py#L55 >> >> and these Python tests are examples of how to access items in the attribute: >> >> >> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >> hon/attributeFindItemTest.py >> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >> hon/attributeItemByPath.py >> >> Hope this helps, >> David > From Indu.Shukla at erdc.dren.mil Wed Jun 24 14:58:37 2015 From: Indu.Shukla at erdc.dren.mil (Shukla, Indu ERDC-RDE-ITL-MS) Date: Wed, 24 Jun 2015 18:58:37 +0000 Subject: [Smtk-developers] Help In-Reply-To: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> Message-ID: Sorry, I took the screen shot but forgot to send you. -----Original Message----- From: David Thompson [mailto:david.thompson at kitware.com] Sent: Wednesday, June 24, 2015 1:55 PM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Indu, It would help to see the script you are running instead of trying to guess what is happening from an error message. David > On Jun 24, 2015, at 2:53 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: > > David, > > Yes, I did had smtk.attribute.Item(). But the compiler still doesn't understands that code. It says "Undefined variable from import:System" > > Thanks, > > Indu > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > Sent: Wednesday, June 24, 2015 1:34 PM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Indu, > > The error does not look like a library issue. Library issues would show up when you run "import smtk". The only way it could be a library issue is if you have multiple versions of the same SMTK libraries and are loading in mismatched versions. > > Are you certain that line is the one causing the problem? If I run > > import smtk > smtk.attribute.Item() > > I get the error you are reporting (because indeed Item is an abstract class). Does "smtk.attribute.Item()" appear anywhere in your script? > > David > >> On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: >> >> David, >> >> Thank you so much for your prompt reply. >> >> I have tried using this line of code "asys = smtk.attribute.System()" but I get this error. >> >> ''NotImplementedError: 'smtk::attribute::Item' represents a C++ abstract class and cannot be instantiated". Am I missing some library? >> >> Indu >> >> -----Original Message----- >> From: David Thompson [mailto:david.thompson at kitware.com] >> Sent: Wednesday, June 24, 2015 11:11 AM >> To: Shukla, Indu ERDC-RDE-ITL-MS >> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS >> Subject: Re: [Smtk-developers] Help >> >> Hi Indu, >> >>> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format. >>> >>> Since I don't have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls and their values. >> >> There is a user's guide (with links to reference API documentation) at: >> >> http://smtk.readthedocs.org/en/latest/ >> >> and in particular, some information about using python: >> >> >> http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind >> ex.html >> >> In terms of reading an attribute from an SBT file, this test is an example of how to do so from a Python script, starting at line 55: >> >> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >> hon/definitionDefaultValueTest.py#L55 >> >> and these Python tests are examples of how to access items in the attribute: >> >> >> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >> hon/attributeFindItemTest.py >> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >> hon/attributeItemByPath.py >> >> Hope this helps, >> David > -------------- next part -------------- A non-text attachment was scrubbed... Name: Attribute_error.png Type: image/png Size: 53849 bytes Desc: Attribute_error.png URL: From david.thompson at kitware.com Wed Jun 24 15:03:07 2015 From: david.thompson at kitware.com (David Thompson) Date: Wed, 24 Jun 2015 15:03:07 -0400 Subject: [Smtk-developers] Help In-Reply-To: References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> Message-ID: <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> Hi Inda, It looks like you call "import smtk" twice. This is not an error, however, the variables asys and mmgr are populated at lines 25 and 26 only if the second import attempt fails. Since it is not failing, there are probably statements below that try to call methods on undefined variables. David > On Jun 24, 2015, at 2:58 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: > > Sorry, I took the screen shot but forgot to send you. > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > Sent: Wednesday, June 24, 2015 1:55 PM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Indu, > > It would help to see the script you are running instead of trying to guess what is happening from an error message. > > David > >> On Jun 24, 2015, at 2:53 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: >> >> David, >> >> Yes, I did had smtk.attribute.Item(). But the compiler still doesn't understands that code. It says "Undefined variable from import:System" >> >> Thanks, >> >> Indu >> >> -----Original Message----- >> From: David Thompson [mailto:david.thompson at kitware.com] >> Sent: Wednesday, June 24, 2015 1:34 PM >> To: Shukla, Indu ERDC-RDE-ITL-MS >> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS >> Subject: Re: [Smtk-developers] Help >> >> Hi Indu, >> >> The error does not look like a library issue. Library issues would show up when you run "import smtk". The only way it could be a library issue is if you have multiple versions of the same SMTK libraries and are loading in mismatched versions. >> >> Are you certain that line is the one causing the problem? If I run >> >> import smtk >> smtk.attribute.Item() >> >> I get the error you are reporting (because indeed Item is an abstract class). Does "smtk.attribute.Item()" appear anywhere in your script? >> >> David >> >>> On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: >>> >>> David, >>> >>> Thank you so much for your prompt reply. >>> >>> I have tried using this line of code "asys = smtk.attribute.System()" but I get this error. >>> >>> ''NotImplementedError: 'smtk::attribute::Item' represents a C++ abstract class and cannot be instantiated". Am I missing some library? >>> >>> Indu >>> >>> -----Original Message----- >>> From: David Thompson [mailto:david.thompson at kitware.com] >>> Sent: Wednesday, June 24, 2015 11:11 AM >>> To: Shukla, Indu ERDC-RDE-ITL-MS >>> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS >>> Subject: Re: [Smtk-developers] Help >>> >>> Hi Indu, >>> >>>> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format. >>>> >>>> Since I don't have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls and their values. >>> >>> There is a user's guide (with links to reference API documentation) at: >>> >>> http://smtk.readthedocs.org/en/latest/ >>> >>> and in particular, some information about using python: >>> >>> >>> http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind >>> ex.html >>> >>> In terms of reading an attribute from an SBT file, this test is an example of how to do so from a Python script, starting at line 55: >>> >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/definitionDefaultValueTest.py#L55 >>> >>> and these Python tests are examples of how to access items in the attribute: >>> >>> >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/attributeFindItemTest.py >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/attributeItemByPath.py >>> >>> Hope this helps, >>> David >> > > From Indu.Shukla at erdc.dren.mil Wed Jun 24 15:27:00 2015 From: Indu.Shukla at erdc.dren.mil (Shukla, Indu ERDC-RDE-ITL-MS) Date: Wed, 24 Jun 2015 19:27:00 +0000 Subject: [Smtk-developers] Help In-Reply-To: <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> Message-ID: David, I simplified the script even further. But still get this error. Error: Traceback (most recent call last): File "", line 5, in File "/Users/indushukla/Documents/workspace/ADH_Test_Today/source/Root/Test/MetXL.py", line 8, in asys = smtk.attribute.System() AttributeError: type object 'SMTKCorePython.smtk.attribute' has no attribute 'System' Thanks! Indu -----Original Message----- From: David Thompson [mailto:david.thompson at kitware.com] Sent: Wednesday, June 24, 2015 2:03 PM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Inda, It looks like you call "import smtk" twice. This is not an error, however, the variables asys and mmgr are populated at lines 25 and 26 only if the second import attempt fails. Since it is not failing, there are probably statements below that try to call methods on undefined variables. David > On Jun 24, 2015, at 2:58 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: > > Sorry, I took the screen shot but forgot to send you. > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > Sent: Wednesday, June 24, 2015 1:55 PM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Indu, > > It would help to see the script you are running instead of trying to guess what is happening from an error message. > > David > >> On Jun 24, 2015, at 2:53 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: >> >> David, >> >> Yes, I did had smtk.attribute.Item(). But the compiler still doesn't understands that code. It says "Undefined variable from import:System" >> >> Thanks, >> >> Indu >> >> -----Original Message----- >> From: David Thompson [mailto:david.thompson at kitware.com] >> Sent: Wednesday, June 24, 2015 1:34 PM >> To: Shukla, Indu ERDC-RDE-ITL-MS >> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS >> Subject: Re: [Smtk-developers] Help >> >> Hi Indu, >> >> The error does not look like a library issue. Library issues would show up when you run "import smtk". The only way it could be a library issue is if you have multiple versions of the same SMTK libraries and are loading in mismatched versions. >> >> Are you certain that line is the one causing the problem? If I run >> >> import smtk >> smtk.attribute.Item() >> >> I get the error you are reporting (because indeed Item is an abstract class). Does "smtk.attribute.Item()" appear anywhere in your script? >> >> David >> >>> On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: >>> >>> David, >>> >>> Thank you so much for your prompt reply. >>> >>> I have tried using this line of code "asys = smtk.attribute.System()" but I get this error. >>> >>> ''NotImplementedError: 'smtk::attribute::Item' represents a C++ abstract class and cannot be instantiated". Am I missing some library? >>> >>> Indu >>> >>> -----Original Message----- >>> From: David Thompson [mailto:david.thompson at kitware.com] >>> Sent: Wednesday, June 24, 2015 11:11 AM >>> To: Shukla, Indu ERDC-RDE-ITL-MS >>> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS >>> Subject: Re: [Smtk-developers] Help >>> >>> Hi Indu, >>> >>>> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format. >>>> >>>> Since I don't have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls and their values. >>> >>> There is a user's guide (with links to reference API documentation) at: >>> >>> http://smtk.readthedocs.org/en/latest/ >>> >>> and in particular, some information about using python: >>> >>> >>> http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind >>> ex.html >>> >>> In terms of reading an attribute from an SBT file, this test is an example of how to do so from a Python script, starting at line 55: >>> >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/definitionDefaultValueTest.py#L55 >>> >>> and these Python tests are examples of how to access items in the attribute: >>> >>> >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/attributeFindItemTest.py >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/attributeItemByPath.py >>> >>> Hope this helps, >>> David >> > > -------------- next part -------------- A non-text attachment was scrubbed... Name: script.png Type: image/png Size: 12107 bytes Desc: script.png URL: From yumin.yuan at kitware.com Wed Jun 24 16:26:17 2015 From: yumin.yuan at kitware.com (Yumin Yuan) Date: Wed, 24 Jun 2015 16:26:17 -0400 Subject: [Smtk-developers] Help In-Reply-To: References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> Message-ID: Hi Indu, Are you using the latest smtk (https://github.com/Kitware/SMTK.git), or some older build from CMB ? The module name should be called "smtkCorePython" now with lower case "smtk". We changed the class name of 'smtk::attribute::Manager' to 'smtk::attribute::System' a while back, so older version of smtk will not have 'System' class. Yumin On Wed, Jun 24, 2015 at 3:27 PM, Shukla, Indu ERDC-RDE-ITL-MS < Indu.Shukla at erdc.dren.mil> wrote: > David, > > I simplified the script even further. But still get this error. > > Error: > Traceback (most recent call last): > File "", line 5, in > File > "/Users/indushukla/Documents/workspace/ADH_Test_Today/source/Root/Test/MetXL.py", > line 8, in > asys = smtk.attribute.System() > AttributeError: type object 'SMTKCorePython.smtk.attribute' has no > attribute 'System' > > Thanks! > > Indu > > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > Sent: Wednesday, June 24, 2015 2:03 PM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Inda, > > It looks like you call "import smtk" twice. This is not an error, however, > the variables asys and mmgr are populated at lines 25 and 26 only if the > second import attempt fails. Since it is not failing, there are probably > statements below that try to call methods on undefined variables. > > David > > > On Jun 24, 2015, at 2:58 PM, Shukla, Indu ERDC-RDE-ITL-MS < > Indu.Shukla at erdc.dren.mil> wrote: > > > > Sorry, I took the screen shot but forgot to send you. > > > > -----Original Message----- > > From: David Thompson [mailto:david.thompson at kitware.com] > > Sent: Wednesday, June 24, 2015 1:55 PM > > To: Shukla, Indu ERDC-RDE-ITL-MS > > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > > Subject: Re: [Smtk-developers] Help > > > > Hi Indu, > > > > It would help to see the script you are running instead of trying to > guess what is happening from an error message. > > > > David > > > >> On Jun 24, 2015, at 2:53 PM, Shukla, Indu ERDC-RDE-ITL-MS < > Indu.Shukla at erdc.dren.mil> wrote: > >> > >> David, > >> > >> Yes, I did had smtk.attribute.Item(). But the compiler still doesn't > understands that code. It says "Undefined variable from import:System" > >> > >> Thanks, > >> > >> Indu > >> > >> -----Original Message----- > >> From: David Thompson [mailto:david.thompson at kitware.com] > >> Sent: Wednesday, June 24, 2015 1:34 PM > >> To: Shukla, Indu ERDC-RDE-ITL-MS > >> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > >> Subject: Re: [Smtk-developers] Help > >> > >> Hi Indu, > >> > >> The error does not look like a library issue. Library issues would show > up when you run "import smtk". The only way it could be a library issue is > if you have multiple versions of the same SMTK libraries and are loading in > mismatched versions. > >> > >> Are you certain that line is the one causing the problem? If I run > >> > >> import smtk > >> smtk.attribute.Item() > >> > >> I get the error you are reporting (because indeed Item is an abstract > class). Does "smtk.attribute.Item()" appear anywhere in your script? > >> > >> David > >> > >>> On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS < > Indu.Shukla at erdc.dren.mil> wrote: > >>> > >>> David, > >>> > >>> Thank you so much for your prompt reply. > >>> > >>> I have tried using this line of code "asys = smtk.attribute.System()" > but I get this error. > >>> > >>> ''NotImplementedError: 'smtk::attribute::Item' represents a C++ > abstract class and cannot be instantiated". Am I missing some library? > >>> > >>> Indu > >>> > >>> -----Original Message----- > >>> From: David Thompson [mailto:david.thompson at kitware.com] > >>> Sent: Wednesday, June 24, 2015 11:11 AM > >>> To: Shukla, Indu ERDC-RDE-ITL-MS > >>> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > >>> Subject: Re: [Smtk-developers] Help > >>> > >>> Hi Indu, > >>> > >>>> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a > list of instance view and attribute view. We are not using our sbt files to > run any kind of simulation. We only want to use this simulation template > just as a form. Upon submission our python script is expected to read the > values from the text boxes/radio buttons/drop downs/checkboxes from the > simulation template and write them into Json format. > >>>> > >>>> Since I don't have access to SMTK API documentation I am running into > issue how to access the those instance views/attribute views and their > values. I am attaching me .sbt file here, please explain me through some > examples how to access those controls and their values. > >>> > >>> There is a user's guide (with links to reference API documentation) at: > >>> > >>> http://smtk.readthedocs.org/en/latest/ > >>> > >>> and in particular, some information about using python: > >>> > >>> > >>> http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind > >>> ex.html > >>> > >>> In terms of reading an attribute from an SBT file, this test is an > example of how to do so from a Python script, starting at line 55: > >>> > >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt > >>> hon/definitionDefaultValueTest.py#L55 > >>> > >>> and these Python tests are examples of how to access items in the > attribute: > >>> > >>> > >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt > >>> hon/attributeFindItemTest.py > >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt > >>> hon/attributeItemByPath.py > >>> > >>> Hope this helps, > >>> David > >> > > > > > > > _______________________________________________ > Smtk-developers mailing list > Smtk-developers at smtk.org > http://public.kitware.com/mailman/listinfo/smtk-developers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Indu.Shukla at erdc.dren.mil Thu Jun 25 10:17:13 2015 From: Indu.Shukla at erdc.dren.mil (Shukla, Indu ERDC-RDE-ITL-MS) Date: Thu, 25 Jun 2015 14:17:13 +0000 Subject: [Smtk-developers] Help In-Reply-To: References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> Message-ID: Yes I am using the same build. Do you suggest to use import smtkCorePython instead of just smtk? I tried that, but it is giving me build errors. I have installed shiboken as well but in the link it says to ignore shiboken warnings. From: Yumin Yuan [mailto:yumin.yuan at kitware.com] Sent: Wednesday, June 24, 2015 3:26 PM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: David Thompson; smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Indu, Are you using the latest smtk (https://github.com/Kitware/SMTK.git), or some older build from CMB ? The module name should be called "smtkCorePython" now with lower case "smtk". We changed the class name of 'smtk::attribute::Manager' to 'smtk::attribute::System' a while back, so older version of smtk will not have 'System' class. Yumin On Wed, Jun 24, 2015 at 3:27 PM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: David, I simplified the script even further. But still get this error. Error: Traceback (most recent call last): File "", line 5, in File "/Users/indushukla/Documents/workspace/ADH_Test_Today/source/Root/Test/MetXL.py", line 8, in asys = smtk.attribute.System() AttributeError: type object 'SMTKCorePython.smtk.attribute' has no attribute 'System' Thanks! Indu -----Original Message----- From: David Thompson [mailto:david.thompson at kitware.com] Sent: Wednesday, June 24, 2015 2:03 PM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Inda, It looks like you call "import smtk" twice. This is not an error, however, the variables asys and mmgr are populated at lines 25 and 26 only if the second import attempt fails. Since it is not failing, there are probably statements below that try to call methods on undefined variables. David > On Jun 24, 2015, at 2:58 PM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: > > Sorry, I took the screen shot but forgot to send you. > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > Sent: Wednesday, June 24, 2015 1:55 PM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Indu, > > It would help to see the script you are running instead of trying to guess what is happening from an error message. > > David > >> On Jun 24, 2015, at 2:53 PM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: >> >> David, >> >> Yes, I did had smtk.attribute.Item(). But the compiler still doesn't understands that code. It says "Undefined variable from import:System" >> >> Thanks, >> >> Indu >> >> -----Original Message----- >> From: David Thompson [mailto:david.thompson at kitware.com] >> Sent: Wednesday, June 24, 2015 1:34 PM >> To: Shukla, Indu ERDC-RDE-ITL-MS >> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS >> Subject: Re: [Smtk-developers] Help >> >> Hi Indu, >> >> The error does not look like a library issue. Library issues would show up when you run "import smtk". The only way it could be a library issue is if you have multiple versions of the same SMTK libraries and are loading in mismatched versions. >> >> Are you certain that line is the one causing the problem? If I run >> >> import smtk >> smtk.attribute.Item() >> >> I get the error you are reporting (because indeed Item is an abstract class). Does "smtk.attribute.Item()" appear anywhere in your script? >> >> David >> >>> On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: >>> >>> David, >>> >>> Thank you so much for your prompt reply. >>> >>> I have tried using this line of code "asys = smtk.attribute.System()" but I get this error. >>> >>> ''NotImplementedError: 'smtk::attribute::Item' represents a C++ abstract class and cannot be instantiated". Am I missing some library? >>> >>> Indu >>> >>> -----Original Message----- >>> From: David Thompson [mailto:david.thompson at kitware.com] >>> Sent: Wednesday, June 24, 2015 11:11 AM >>> To: Shukla, Indu ERDC-RDE-ITL-MS >>> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS >>> Subject: Re: [Smtk-developers] Help >>> >>> Hi Indu, >>> >>>> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format. >>>> >>>> Since I don't have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls and their values. >>> >>> There is a user's guide (with links to reference API documentation) at: >>> >>> http://smtk.readthedocs.org/en/latest/ >>> >>> and in particular, some information about using python: >>> >>> >>> http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind >>> ex.html >>> >>> In terms of reading an attribute from an SBT file, this test is an example of how to do so from a Python script, starting at line 55: >>> >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/definitionDefaultValueTest.py#L55 >>> >>> and these Python tests are examples of how to access items in the attribute: >>> >>> >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/attributeFindItemTest.py >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/attributeItemByPath.py >>> >>> Hope this helps, >>> David >> > > _______________________________________________ Smtk-developers mailing list Smtk-developers at smtk.org http://public.kitware.com/mailman/listinfo/smtk-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: From yumin.yuan at kitware.com Thu Jun 25 10:30:20 2015 From: yumin.yuan at kitware.com (Yumin Yuan) Date: Thu, 25 Jun 2015 10:30:20 -0400 Subject: [Smtk-developers] Help In-Reply-To: References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> Message-ID: Hi Indu, On Thu, Jun 25, 2015 at 10:17 AM, Shukla, Indu ERDC-RDE-ITL-MS < Indu.Shukla at erdc.dren.mil> wrote: > Yes I am using the same build. Do you suggest to use import > smtkCorePython instead of just smtk? > No, what I meant is, in the latest smtk build, there should be no "SMTKCorePython" lib anymore, instead you should have a "smtkCorePython" lib. The fact that you error message says "AttributeError: type object 'SMTKCorePython.smtk.attribute' has no attribute 'System'" suggests that this is an older version of smtk, because the latest smtk should have said "AttributeError: type object 'smtkCorePython.smtk.attribute' has no .....". Yumin > I tried that, but it is giving me build errors. I have installed shiboken > as well but in the link it says to ignore shiboken warnings. > > > *From:* Yumin Yuan [mailto:yumin.yuan at kitware.com] > *Sent:* Wednesday, June 24, 2015 3:26 PM > *To:* Shukla, Indu ERDC-RDE-ITL-MS > *Cc:* David Thompson; smtk-developers at smtk.org; Hines, Amanda M > ERDC-RDE-ITL-MS > *Subject:* Re: [Smtk-developers] Help > > > > Hi Indu, > > > > Are you using the latest smtk (https://github.com/Kitware/SMTK.git), or > some older build from CMB ? The module name should be called > "smtkCorePython" now with lower case "smtk". We changed the class name of > 'smtk::attribute::Manager' to 'smtk::attribute::System' a while back, so > older version of smtk will not have 'System' class. > > > > > > Yumin > > > > On Wed, Jun 24, 2015 at 3:27 PM, Shukla, Indu ERDC-RDE-ITL-MS < > Indu.Shukla at erdc.dren.mil> wrote: > > David, > > I simplified the script even further. But still get this error. > > Error: > Traceback (most recent call last): > File "", line 5, in > File > "/Users/indushukla/Documents/workspace/ADH_Test_Today/source/Root/Test/MetXL.py", > line 8, in > asys = smtk.attribute.System() > AttributeError: type object 'SMTKCorePython.smtk.attribute' has no > attribute 'System' > > Thanks! > > Indu > > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > > Sent: Wednesday, June 24, 2015 2:03 PM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Inda, > > It looks like you call "import smtk" twice. This is not an error, however, > the variables asys and mmgr are populated at lines 25 and 26 only if the > second import attempt fails. Since it is not failing, there are probably > statements below that try to call methods on undefined variables. > > David > > > On Jun 24, 2015, at 2:58 PM, Shukla, Indu ERDC-RDE-ITL-MS < > Indu.Shukla at erdc.dren.mil> wrote: > > > > Sorry, I took the screen shot but forgot to send you. > > > > -----Original Message----- > > From: David Thompson [mailto:david.thompson at kitware.com] > > Sent: Wednesday, June 24, 2015 1:55 PM > > To: Shukla, Indu ERDC-RDE-ITL-MS > > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > > Subject: Re: [Smtk-developers] Help > > > > Hi Indu, > > > > It would help to see the script you are running instead of trying to > guess what is happening from an error message. > > > > David > > > >> On Jun 24, 2015, at 2:53 PM, Shukla, Indu ERDC-RDE-ITL-MS < > Indu.Shukla at erdc.dren.mil> wrote: > >> > >> David, > >> > >> Yes, I did had smtk.attribute.Item(). But the compiler still doesn't > understands that code. It says "Undefined variable from import:System" > >> > >> Thanks, > >> > >> Indu > >> > >> -----Original Message----- > >> From: David Thompson [mailto:david.thompson at kitware.com] > >> Sent: Wednesday, June 24, 2015 1:34 PM > >> To: Shukla, Indu ERDC-RDE-ITL-MS > >> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > >> Subject: Re: [Smtk-developers] Help > >> > >> Hi Indu, > >> > >> The error does not look like a library issue. Library issues would show > up when you run "import smtk". The only way it could be a library issue is > if you have multiple versions of the same SMTK libraries and are loading in > mismatched versions. > >> > >> Are you certain that line is the one causing the problem? If I run > >> > >> import smtk > >> smtk.attribute.Item() > >> > >> I get the error you are reporting (because indeed Item is an abstract > class). Does "smtk.attribute.Item()" appear anywhere in your script? > >> > >> David > >> > >>> On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS < > Indu.Shukla at erdc.dren.mil> wrote: > >>> > >>> David, > >>> > >>> Thank you so much for your prompt reply. > >>> > >>> I have tried using this line of code "asys = smtk.attribute.System()" > but I get this error. > >>> > >>> ''NotImplementedError: 'smtk::attribute::Item' represents a C++ > abstract class and cannot be instantiated". Am I missing some library? > >>> > >>> Indu > >>> > >>> -----Original Message----- > >>> From: David Thompson [mailto:david.thompson at kitware.com] > >>> Sent: Wednesday, June 24, 2015 11:11 AM > >>> To: Shukla, Indu ERDC-RDE-ITL-MS > >>> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > >>> Subject: Re: [Smtk-developers] Help > >>> > >>> Hi Indu, > >>> > >>>> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a > list of instance view and attribute view. We are not using our sbt files to > run any kind of simulation. We only want to use this simulation template > just as a form. Upon submission our python script is expected to read the > values from the text boxes/radio buttons/drop downs/checkboxes from the > simulation template and write them into Json format. > >>>> > >>>> Since I don't have access to SMTK API documentation I am running into > issue how to access the those instance views/attribute views and their > values. I am attaching me .sbt file here, please explain me through some > examples how to access those controls and their values. > >>> > >>> There is a user's guide (with links to reference API documentation) at: > >>> > >>> http://smtk.readthedocs.org/en/latest/ > >>> > >>> and in particular, some information about using python: > >>> > >>> > >>> http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind > >>> ex.html > >>> > >>> In terms of reading an attribute from an SBT file, this test is an > example of how to do so from a Python script, starting at line 55: > >>> > >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt > >>> hon/definitionDefaultValueTest.py#L55 > >>> > >>> and these Python tests are examples of how to access items in the > attribute: > >>> > >>> > >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt > >>> hon/attributeFindItemTest.py > >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt > >>> hon/attributeItemByPath.py > >>> > >>> Hope this helps, > >>> David > >> > > > > > > > _______________________________________________ > Smtk-developers mailing list > Smtk-developers at smtk.org > http://public.kitware.com/mailman/listinfo/smtk-developers > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Indu.Shukla at erdc.dren.mil Thu Jun 25 10:53:09 2015 From: Indu.Shukla at erdc.dren.mil (Shukla, Indu ERDC-RDE-ITL-MS) Date: Thu, 25 Jun 2015 14:53:09 +0000 Subject: [Smtk-developers] Help In-Reply-To: References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> Message-ID: Thanks Yumin. Can you suggest me the path of System attribute so that I can manually check it? It seems I do have right version. From: Yumin Yuan [mailto:yumin.yuan at kitware.com] Sent: Thursday, June 25, 2015 9:30 AM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: David Thompson; smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Indu, On Thu, Jun 25, 2015 at 10:17 AM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: Yes I am using the same build. Do you suggest to use import smtkCorePython instead of just smtk? No, what I meant is, in the latest smtk build, there should be no "SMTKCorePython" lib anymore, instead you should have a "smtkCorePython" lib. The fact that you error message says "AttributeError: type object 'SMTKCorePython.smtk.attribute' has no attribute 'System'" suggests that this is an older version of smtk, because the latest smtk should have said "AttributeError: type object 'smtkCorePython.smtk.attribute' has no .....". Yumin I tried that, but it is giving me build errors. I have installed shiboken as well but in the link it says to ignore shiboken warnings. From: Yumin Yuan [mailto:yumin.yuan at kitware.com] Sent: Wednesday, June 24, 2015 3:26 PM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: David Thompson; smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Indu, Are you using the latest smtk (https://github.com/Kitware/SMTK.git), or some older build from CMB ? The module name should be called "smtkCorePython" now with lower case "smtk". We changed the class name of 'smtk::attribute::Manager' to 'smtk::attribute::System' a while back, so older version of smtk will not have 'System' class. Yumin On Wed, Jun 24, 2015 at 3:27 PM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: David, I simplified the script even further. But still get this error. Error: Traceback (most recent call last): File "", line 5, in File "/Users/indushukla/Documents/workspace/ADH_Test_Today/source/Root/Test/MetXL.py", line 8, in asys = smtk.attribute.System() AttributeError: type object 'SMTKCorePython.smtk.attribute' has no attribute 'System' Thanks! Indu -----Original Message----- From: David Thompson [mailto:david.thompson at kitware.com] Sent: Wednesday, June 24, 2015 2:03 PM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Inda, It looks like you call "import smtk" twice. This is not an error, however, the variables asys and mmgr are populated at lines 25 and 26 only if the second import attempt fails. Since it is not failing, there are probably statements below that try to call methods on undefined variables. David > On Jun 24, 2015, at 2:58 PM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: > > Sorry, I took the screen shot but forgot to send you. > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > Sent: Wednesday, June 24, 2015 1:55 PM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Indu, > > It would help to see the script you are running instead of trying to guess what is happening from an error message. > > David > >> On Jun 24, 2015, at 2:53 PM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: >> >> David, >> >> Yes, I did had smtk.attribute.Item(). But the compiler still doesn't understands that code. It says "Undefined variable from import:System" >> >> Thanks, >> >> Indu >> >> -----Original Message----- >> From: David Thompson [mailto:david.thompson at kitware.com] >> Sent: Wednesday, June 24, 2015 1:34 PM >> To: Shukla, Indu ERDC-RDE-ITL-MS >> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS >> Subject: Re: [Smtk-developers] Help >> >> Hi Indu, >> >> The error does not look like a library issue. Library issues would show up when you run "import smtk". The only way it could be a library issue is if you have multiple versions of the same SMTK libraries and are loading in mismatched versions. >> >> Are you certain that line is the one causing the problem? If I run >> >> import smtk >> smtk.attribute.Item() >> >> I get the error you are reporting (because indeed Item is an abstract class). Does "smtk.attribute.Item()" appear anywhere in your script? >> >> David >> >>> On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: >>> >>> David, >>> >>> Thank you so much for your prompt reply. >>> >>> I have tried using this line of code "asys = smtk.attribute.System()" but I get this error. >>> >>> ''NotImplementedError: 'smtk::attribute::Item' represents a C++ abstract class and cannot be instantiated". Am I missing some library? >>> >>> Indu >>> >>> -----Original Message----- >>> From: David Thompson [mailto:david.thompson at kitware.com] >>> Sent: Wednesday, June 24, 2015 11:11 AM >>> To: Shukla, Indu ERDC-RDE-ITL-MS >>> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS >>> Subject: Re: [Smtk-developers] Help >>> >>> Hi Indu, >>> >>>> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format. >>>> >>>> Since I don't have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls and their values. >>> >>> There is a user's guide (with links to reference API documentation) at: >>> >>> http://smtk.readthedocs.org/en/latest/ >>> >>> and in particular, some information about using python: >>> >>> >>> http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind >>> ex.html >>> >>> In terms of reading an attribute from an SBT file, this test is an example of how to do so from a Python script, starting at line 55: >>> >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/definitionDefaultValueTest.py#L55 >>> >>> and these Python tests are examples of how to access items in the attribute: >>> >>> >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/attributeFindItemTest.py >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/attributeItemByPath.py >>> >>> Hope this helps, >>> David >> > > _______________________________________________ Smtk-developers mailing list Smtk-developers at smtk.org http://public.kitware.com/mailman/listinfo/smtk-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: From yumin.yuan at kitware.com Thu Jun 25 11:21:09 2015 From: yumin.yuan at kitware.com (Yumin Yuan) Date: Thu, 25 Jun 2015 11:21:09 -0400 Subject: [Smtk-developers] Help In-Reply-To: References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> Message-ID: Hi Indu, On Thu, Jun 25, 2015 at 10:53 AM, Shukla, Indu ERDC-RDE-ITL-MS < Indu.Shukla at erdc.dren.mil> wrote: > Thanks Yumin. Can you suggest me the path of System attribute so that I > can manually check it? > I am not sure I understand your question. Your script is ok. You can check your build/install directory and make sure you do have "smtkCorePython" there. > It seems I do have right version. > > > Check your PYTHONPATH environment, make sure you did not accidentally included a path from older smtk build (which will explain why the "SMTKCorePython" lib is pulled in). From a python shell, you can run help('modules') You should see smtkCorePython listed there. If you see SMTKCorePython instead, your PYTHONPATH is including an older smtk build/install. Yumin *From:* Yumin Yuan [mailto:yumin.yuan at kitware.com] > *Sent:* Thursday, June 25, 2015 9:30 AM > *To:* Shukla, Indu ERDC-RDE-ITL-MS > > *Cc:* David Thompson; smtk-developers at smtk.org; Hines, Amanda M > ERDC-RDE-ITL-MS > *Subject:* Re: [Smtk-developers] Help > > > > Hi Indu, > > > > On Thu, Jun 25, 2015 at 10:17 AM, Shukla, Indu ERDC-RDE-ITL-MS < > Indu.Shukla at erdc.dren.mil> wrote: > > Yes I am using the same build. Do you suggest to use import smtkCorePython > instead of just smtk? > > > > No, what I meant is, in the latest smtk build, there should be no > "SMTKCorePython" lib anymore, instead you should have a "smtkCorePython" > lib. The fact that you error message says "AttributeError: type object > 'SMTKCorePython.smtk.attribute' has no attribute 'System'" suggests that > this is an older version of smtk, because the latest smtk should have said > "AttributeError: type object 'smtkCorePython.smtk.attribute' has no > .....". > > > > Yumin > > > > I tried that, but it is giving me build errors. I have installed > shiboken as well but in the link it says to ignore shiboken warnings. > > > > *From:* Yumin Yuan [mailto:yumin.yuan at kitware.com] > *Sent:* Wednesday, June 24, 2015 3:26 PM > *To:* Shukla, Indu ERDC-RDE-ITL-MS > *Cc:* David Thompson; smtk-developers at smtk.org; Hines, Amanda M > ERDC-RDE-ITL-MS > *Subject:* Re: [Smtk-developers] Help > > > > Hi Indu, > > > > Are you using the latest smtk (https://github.com/Kitware/SMTK.git), or > some older build from CMB ? The module name should be called > "smtkCorePython" now with lower case "smtk". We changed the class name of > 'smtk::attribute::Manager' to 'smtk::attribute::System' a while back, so > older version of smtk will not have 'System' class. > > > > > > Yumin > > > > On Wed, Jun 24, 2015 at 3:27 PM, Shukla, Indu ERDC-RDE-ITL-MS < > Indu.Shukla at erdc.dren.mil> wrote: > > David, > > I simplified the script even further. But still get this error. > > Error: > Traceback (most recent call last): > File "", line 5, in > File > "/Users/indushukla/Documents/workspace/ADH_Test_Today/source/Root/Test/MetXL.py", > line 8, in > asys = smtk.attribute.System() > AttributeError: type object 'SMTKCorePython.smtk.attribute' has no > attribute 'System' > > Thanks! > > Indu > > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > > Sent: Wednesday, June 24, 2015 2:03 PM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Inda, > > It looks like you call "import smtk" twice. This is not an error, however, > the variables asys and mmgr are populated at lines 25 and 26 only if the > second import attempt fails. Since it is not failing, there are probably > statements below that try to call methods on undefined variables. > > David > > > On Jun 24, 2015, at 2:58 PM, Shukla, Indu ERDC-RDE-ITL-MS < > Indu.Shukla at erdc.dren.mil> wrote: > > > > Sorry, I took the screen shot but forgot to send you. > > > > -----Original Message----- > > From: David Thompson [mailto:david.thompson at kitware.com] > > Sent: Wednesday, June 24, 2015 1:55 PM > > To: Shukla, Indu ERDC-RDE-ITL-MS > > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > > Subject: Re: [Smtk-developers] Help > > > > Hi Indu, > > > > It would help to see the script you are running instead of trying to > guess what is happening from an error message. > > > > David > > > >> On Jun 24, 2015, at 2:53 PM, Shukla, Indu ERDC-RDE-ITL-MS < > Indu.Shukla at erdc.dren.mil> wrote: > >> > >> David, > >> > >> Yes, I did had smtk.attribute.Item(). But the compiler still doesn't > understands that code. It says "Undefined variable from import:System" > >> > >> Thanks, > >> > >> Indu > >> > >> -----Original Message----- > >> From: David Thompson [mailto:david.thompson at kitware.com] > >> Sent: Wednesday, June 24, 2015 1:34 PM > >> To: Shukla, Indu ERDC-RDE-ITL-MS > >> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > >> Subject: Re: [Smtk-developers] Help > >> > >> Hi Indu, > >> > >> The error does not look like a library issue. Library issues would show > up when you run "import smtk". The only way it could be a library issue is > if you have multiple versions of the same SMTK libraries and are loading in > mismatched versions. > >> > >> Are you certain that line is the one causing the problem? If I run > >> > >> import smtk > >> smtk.attribute.Item() > >> > >> I get the error you are reporting (because indeed Item is an abstract > class). Does "smtk.attribute.Item()" appear anywhere in your script? > >> > >> David > >> > >>> On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS < > Indu.Shukla at erdc.dren.mil> wrote: > >>> > >>> David, > >>> > >>> Thank you so much for your prompt reply. > >>> > >>> I have tried using this line of code "asys = smtk.attribute.System()" > but I get this error. > >>> > >>> ''NotImplementedError: 'smtk::attribute::Item' represents a C++ > abstract class and cannot be instantiated". Am I missing some library? > >>> > >>> Indu > >>> > >>> -----Original Message----- > >>> From: David Thompson [mailto:david.thompson at kitware.com] > >>> Sent: Wednesday, June 24, 2015 11:11 AM > >>> To: Shukla, Indu ERDC-RDE-ITL-MS > >>> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > >>> Subject: Re: [Smtk-developers] Help > >>> > >>> Hi Indu, > >>> > >>>> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a > list of instance view and attribute view. We are not using our sbt files to > run any kind of simulation. We only want to use this simulation template > just as a form. Upon submission our python script is expected to read the > values from the text boxes/radio buttons/drop downs/checkboxes from the > simulation template and write them into Json format. > >>>> > >>>> Since I don't have access to SMTK API documentation I am running into > issue how to access the those instance views/attribute views and their > values. I am attaching me .sbt file here, please explain me through some > examples how to access those controls and their values. > >>> > >>> There is a user's guide (with links to reference API documentation) at: > >>> > >>> http://smtk.readthedocs.org/en/latest/ > >>> > >>> and in particular, some information about using python: > >>> > >>> > >>> http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind > >>> ex.html > >>> > >>> In terms of reading an attribute from an SBT file, this test is an > example of how to do so from a Python script, starting at line 55: > >>> > >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt > >>> hon/definitionDefaultValueTest.py#L55 > >>> > >>> and these Python tests are examples of how to access items in the > attribute: > >>> > >>> > >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt > >>> hon/attributeFindItemTest.py > >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt > >>> hon/attributeItemByPath.py > >>> > >>> Hope this helps, > >>> David > >> > > > > > > > _______________________________________________ > Smtk-developers mailing list > Smtk-developers at smtk.org > http://public.kitware.com/mailman/listinfo/smtk-developers > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Indu.Shukla at erdc.dren.mil Thu Jun 25 16:05:49 2015 From: Indu.Shukla at erdc.dren.mil (Shukla, Indu ERDC-RDE-ITL-MS) Date: Thu, 25 Jun 2015 20:05:49 +0000 Subject: [Smtk-developers] Help In-Reply-To: References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> Message-ID: I have resolved smtkCorePython issue. Thank you so much for the prompt reply. I have one more question to ask. Here I am attaching is the sbi file I am trying to read. I was trying to get the value of the ProjectName String inside the Globals attribute. I can get the item but not the value. Here?s what I did log = smtk.io.Logger() rdr = smtk.io.AttributeReader() rdr.read(asys, sys.argv[1], log) att = asys.findAttribute('Globals?) gr = att.findString('ProjectName') gr = att.findGroup('ProjectInformation') gr.find('ProjectName') Please let me know how can I access the value of my ProjectName. Thanks, Indu Check your PYTHONPATH environment, make sure you did not accidentally included a path from older smtk build (which will explain why the "SMTKCorePython" lib is pulled in). From a python shell, you can run help('modules') You should see smtkCorePython listed there. If you see SMTKCorePython instead, your PYTHONPATH is including an older smtk build/install. Yumin From: Yumin Yuan [mailto:yumin.yuan at kitware.com] Sent: Thursday, June 25, 2015 9:30 AM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: David Thompson; smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Indu, On Thu, Jun 25, 2015 at 10:17 AM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: Yes I am using the same build. Do you suggest to use import smtkCorePython instead of just smtk? No, what I meant is, in the latest smtk build, there should be no "SMTKCorePython" lib anymore, instead you should have a "smtkCorePython" lib. The fact that you error message says "AttributeError: type object 'SMTKCorePython.smtk.attribute' has no attribute 'System'" suggests that this is an older version of smtk, because the latest smtk should have said "AttributeError: type object 'smtkCorePython.smtk.attribute' has no .....". Yumin I tried that, but it is giving me build errors. I have installed shiboken as well but in the link it says to ignore shiboken warnings. From: Yumin Yuan [mailto:yumin.yuan at kitware.com] Sent: Wednesday, June 24, 2015 3:26 PM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: David Thompson; smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Indu, Are you using the latest smtk (https://github.com/Kitware/SMTK.git), or some older build from CMB ? The module name should be called "smtkCorePython" now with lower case "smtk". We changed the class name of 'smtk::attribute::Manager' to 'smtk::attribute::System' a while back, so older version of smtk will not have 'System' class. Yumin On Wed, Jun 24, 2015 at 3:27 PM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: David, I simplified the script even further. But still get this error. Error: Traceback (most recent call last): File "", line 5, in File "/Users/indushukla/Documents/workspace/ADH_Test_Today/source/Root/Test/MetXL.py", line 8, in asys = smtk.attribute.System() AttributeError: type object 'SMTKCorePython.smtk.attribute' has no attribute 'System' Thanks! Indu -----Original Message----- From: David Thompson [mailto:david.thompson at kitware.com] Sent: Wednesday, June 24, 2015 2:03 PM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Inda, It looks like you call "import smtk" twice. This is not an error, however, the variables asys and mmgr are populated at lines 25 and 26 only if the second import attempt fails. Since it is not failing, there are probably statements below that try to call methods on undefined variables. David > On Jun 24, 2015, at 2:58 PM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: > > Sorry, I took the screen shot but forgot to send you. > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > Sent: Wednesday, June 24, 2015 1:55 PM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Indu, > > It would help to see the script you are running instead of trying to guess what is happening from an error message. > > David > >> On Jun 24, 2015, at 2:53 PM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: >> >> David, >> >> Yes, I did had smtk.attribute.Item(). But the compiler still doesn't understands that code. It says "Undefined variable from import:System" >> >> Thanks, >> >> Indu >> >> -----Original Message----- >> From: David Thompson [mailto:david.thompson at kitware.com] >> Sent: Wednesday, June 24, 2015 1:34 PM >> To: Shukla, Indu ERDC-RDE-ITL-MS >> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS >> Subject: Re: [Smtk-developers] Help >> >> Hi Indu, >> >> The error does not look like a library issue. Library issues would show up when you run "import smtk". The only way it could be a library issue is if you have multiple versions of the same SMTK libraries and are loading in mismatched versions. >> >> Are you certain that line is the one causing the problem? If I run >> >> import smtk >> smtk.attribute.Item() >> >> I get the error you are reporting (because indeed Item is an abstract class). Does "smtk.attribute.Item()" appear anywhere in your script? >> >> David >> >>> On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS > wrote: >>> >>> David, >>> >>> Thank you so much for your prompt reply. >>> >>> I have tried using this line of code "asys = smtk.attribute.System()" but I get this error. >>> >>> ''NotImplementedError: 'smtk::attribute::Item' represents a C++ abstract class and cannot be instantiated". Am I missing some library? >>> >>> Indu >>> >>> -----Original Message----- >>> From: David Thompson [mailto:david.thompson at kitware.com] >>> Sent: Wednesday, June 24, 2015 11:11 AM >>> To: Shukla, Indu ERDC-RDE-ITL-MS >>> Cc: smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS >>> Subject: Re: [Smtk-developers] Help >>> >>> Hi Indu, >>> >>>> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format. >>>> >>>> Since I don't have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls and their values. >>> >>> There is a user's guide (with links to reference API documentation) at: >>> >>> http://smtk.readthedocs.org/en/latest/ >>> >>> and in particular, some information about using python: >>> >>> >>> http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind >>> ex.html >>> >>> In terms of reading an attribute from an SBT file, this test is an example of how to do so from a Python script, starting at line 55: >>> >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/definitionDefaultValueTest.py#L55 >>> >>> and these Python tests are examples of how to access items in the attribute: >>> >>> >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/attributeFindItemTest.py >>> https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt >>> hon/attributeItemByPath.py >>> >>> Hope this helps, >>> David >> > > _______________________________________________ Smtk-developers mailing list Smtk-developers at smtk.org http://public.kitware.com/mailman/listinfo/smtk-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test.sbi Type: application/octet-stream Size: 47811 bytes Desc: test.sbi URL: From david.thompson at kitware.com Thu Jun 25 18:30:46 2015 From: david.thompson at kitware.com (David Thompson) Date: Thu, 25 Jun 2015 18:30:46 -0400 Subject: [Smtk-developers] Help In-Reply-To: References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> Message-ID: <9B9AEF6E-5BF3-4DCE-B0A6-C9F9139F6132@kitware.com> Hi Indu, > ... > att = asys.findAttribute('Globals?) > gr = att.findString('ProjectName') > gr = att.findGroup('ProjectInformation') > gr.find('ProjectName') > > Please let me know how can I access the value of my ProjectName. The issue is that the "find" methods return a Python object that corresponds to the base "Item" type (which does not have methods to fetch data since no data format is specified in base class). The base Item must be converted to one of the proper type (StringItem in this case), which is done with smtk.attribute.to_concrete(). Either of these should work: 1. Fetch each item in the hierarchy att = asys.findAttribute('Globals') gr = att.findGroup('ProjectInformation') nm = smtk.attribute.to_concrete(gr.find('ProjectName')) print nm.value(0) 2. If you have a *really* recent SMTK (fetched within the last few days), you can do this: att = asys.findAttribute('Globals') nm = smtk.attribute.to_concrete( att.itemAtPath('ProjectInformation/ProjectName', '/')) print nm.value(0) where the '/' argument to "itemAtPath" is a separator character that divides the first argument into the list of items to descend. There appears to be a bug in the variant of att.find() that takes a smtk.attribute.SearchStyle as its second argument or there would be a third way. Hopefully one of the above will work for you until it is fixed. David From Indu.Shukla at erdc.dren.mil Fri Jun 26 14:21:27 2015 From: Indu.Shukla at erdc.dren.mil (Shukla, Indu ERDC-RDE-ITL-MS) Date: Fri, 26 Jun 2015 18:21:27 +0000 Subject: [Smtk-developers] Help In-Reply-To: <9B9AEF6E-5BF3-4DCE-B0A6-C9F9139F6132@kitware.com> References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> <9B9AEF6E-5BF3-4DCE-B0A6-C9F9139F6132@kitware.com> Message-ID: Thank you so much David. -----Original Message----- From: David Thompson [mailto:david.thompson at kitware.com] Sent: Thursday, June 25, 2015 5:31 PM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: Yumin Yuan; smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Indu, > ... > att = asys.findAttribute('Globals?) > gr = att.findString('ProjectName') > gr = att.findGroup('ProjectInformation') > gr.find('ProjectName') > > Please let me know how can I access the value of my ProjectName. The issue is that the "find" methods return a Python object that corresponds to the base "Item" type (which does not have methods to fetch data since no data format is specified in base class). The base Item must be converted to one of the proper type (StringItem in this case), which is done with smtk.attribute.to_concrete(). Either of these should work: 1. Fetch each item in the hierarchy att = asys.findAttribute('Globals') gr = att.findGroup('ProjectInformation') nm = smtk.attribute.to_concrete(gr.find('ProjectName')) print nm.value(0) 2. If you have a *really* recent SMTK (fetched within the last few days), you can do this: att = asys.findAttribute('Globals') nm = smtk.attribute.to_concrete( att.itemAtPath('ProjectInformation/ProjectName', '/')) print nm.value(0) where the '/' argument to "itemAtPath" is a separator character that divides the first argument into the list of items to descend. There appears to be a bug in the variant of att.find() that takes a smtk.attribute.SearchStyle as its second argument or there would be a third way. Hopefully one of the above will work for you until it is fixed. David From Indu.Shukla at erdc.dren.mil Fri Jun 26 15:16:19 2015 From: Indu.Shukla at erdc.dren.mil (Shukla, Indu ERDC-RDE-ITL-MS) Date: Fri, 26 Jun 2015 19:16:19 +0000 Subject: [Smtk-developers] Help In-Reply-To: <9B9AEF6E-5BF3-4DCE-B0A6-C9F9139F6132@kitware.com> References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> <9B9AEF6E-5BF3-4DCE-B0A6-C9F9139F6132@kitware.com> Message-ID: David, Yumin, This code att = asys.findAttribute('Globals') gr = att.findGroup('ProjectInformation') nm = smtk.attribute.to_concrete(gr.find('ProjectName')) #print nm.value(0) Works great to access the InstanceView items. How to I access items and its values in attribute view? Here's my example. station 0 1234 0 0 0 0 0 0 0 0 wind station 0 1234 0 0 0 0 0 0 0 0 Thank you! Indu -----Original Message----- From: David Thompson [mailto:david.thompson at kitware.com] Sent: Thursday, June 25, 2015 5:31 PM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: Yumin Yuan; smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Indu, > ... > att = asys.findAttribute('Globals?) > gr = att.findString('ProjectName') > gr = att.findGroup('ProjectInformation') > gr.find('ProjectName') > > Please let me know how can I access the value of my ProjectName. The issue is that the "find" methods return a Python object that corresponds to the base "Item" type (which does not have methods to fetch data since no data format is specified in base class). The base Item must be converted to one of the proper type (StringItem in this case), which is done with smtk.attribute.to_concrete(). Either of these should work: 1. Fetch each item in the hierarchy att = asys.findAttribute('Globals') gr = att.findGroup('ProjectInformation') nm = smtk.attribute.to_concrete(gr.find('ProjectName')) print nm.value(0) 2. If you have a *really* recent SMTK (fetched within the last few days), you can do this: att = asys.findAttribute('Globals') nm = smtk.attribute.to_concrete( att.itemAtPath('ProjectInformation/ProjectName', '/')) print nm.value(0) where the '/' argument to "itemAtPath" is a separator character that divides the first argument into the list of items to descend. There appears to be a bug in the variant of att.find() that takes a smtk.attribute.SearchStyle as its second argument or there would be a third way. Hopefully one of the above will work for you until it is fixed. David From david.thompson at kitware.com Fri Jun 26 15:19:16 2015 From: david.thompson at kitware.com (David Thompson) Date: Fri, 26 Jun 2015 15:19:16 -0400 Subject: [Smtk-developers] Help In-Reply-To: References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> <9B9AEF6E-5BF3-4DCE-B0A6-C9F9139F6132@kitware.com> Message-ID: <9BA62D55-7D5B-4C63-94F0-2F20AA720D27@kitware.com> Hi Indu, I'm a little unclear on exactly what information you want to get from the "Tide-0" attribute. David > On Jun 26, 2015, at 3:16 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: > > David, Yumin, > > This code > > att = asys.findAttribute('Globals') > gr = att.findGroup('ProjectInformation') > nm = smtk.attribute.to_concrete(gr.find('ProjectName')) > #print nm.value(0) > > Works great to access the InstanceView items. How to I access items and its values in attribute view? Here's my example. > > > > > station > 0 > 1234 > > > 0 > 0 > 0 > 0 > > > 0 > 0 > 0 > 0 > > > > > > > > > > > wind station > 0 > 1234 > > > 0 > 0 > 0 > 0 > > > 0 > 0 > 0 > 0 > > > > > > > > > Thank you! > > Indu > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > Sent: Thursday, June 25, 2015 5:31 PM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: Yumin Yuan; smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Indu, > >> ... >> att = asys.findAttribute('Globals?) >> gr = att.findString('ProjectName') >> gr = att.findGroup('ProjectInformation') >> gr.find('ProjectName') >> >> Please let me know how can I access the value of my ProjectName. > > The issue is that the "find" methods return a Python object that corresponds to the base "Item" type (which does not have methods to fetch data since no data format is specified in base class). The base Item must be converted to one of the proper type (StringItem in this case), which is done with smtk.attribute.to_concrete(). Either of these should work: > > 1. Fetch each item in the hierarchy > > att = asys.findAttribute('Globals') > gr = att.findGroup('ProjectInformation') > nm = smtk.attribute.to_concrete(gr.find('ProjectName')) > print nm.value(0) > > 2. If you have a *really* recent SMTK (fetched within the last few days), you can do this: > > att = asys.findAttribute('Globals') > nm = smtk.attribute.to_concrete( > att.itemAtPath('ProjectInformation/ProjectName', '/')) > print nm.value(0) > > where the '/' argument to "itemAtPath" is a separator character that divides the first argument into the list of items to descend. > > There appears to be a bug in the variant of att.find() that takes a smtk.attribute.SearchStyle as its second argument or there would be a third way. Hopefully one of the above will work for you until it is fixed. > > David From Indu.Shukla at erdc.dren.mil Fri Jun 26 15:31:08 2015 From: Indu.Shukla at erdc.dren.mil (Shukla, Indu ERDC-RDE-ITL-MS) Date: Fri, 26 Jun 2015 19:31:08 +0000 Subject: [Smtk-developers] Help In-Reply-To: <9BA62D55-7D5B-4C63-94F0-2F20AA720D27@kitware.com> References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> <9B9AEF6E-5BF3-4DCE-B0A6-C9F9139F6132@kitware.com> <9BA62D55-7D5B-4C63-94F0-2F20AA720D27@kitware.com> Message-ID: David, Tide and wind and the tabular entries in my form. There will be no fixed number of entries for tide and wind, they can vary according to the situation. In this test example I sent you, I only have one each for tide (Tide-0) and wind (Wind-0). I need to know, 1. How many of tide entries are there 2. How many wind entries are there. 3. Then access the items(Gage Station,{Station,Agency,Station ID}) and its values (Gage Station,{station,0,1234}) of each tide and wind entries. Thanks, Indu -----Original Message----- From: David Thompson [mailto:david.thompson at kitware.com] Sent: Friday, June 26, 2015 2:19 PM To: Shukla, Indu ERDC-RDE-ITL-MS Cc: Yumin Yuan; smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS Subject: Re: [Smtk-developers] Help Hi Indu, I'm a little unclear on exactly what information you want to get from the "Tide-0" attribute. David > On Jun 26, 2015, at 3:16 PM, Shukla, Indu ERDC-RDE-ITL-MS wrote: > > David, Yumin, > > This code > > att = asys.findAttribute('Globals') > gr = att.findGroup('ProjectInformation') > nm = smtk.attribute.to_concrete(gr.find('ProjectName')) > #print nm.value(0) > > Works great to access the InstanceView items. How to I access items and its values in attribute view? Here's my example. > > > > > station > 0 > 1234 > > > 0 > 0 > 0 > 0 > > > 0 > 0 > 0 > 0 > > > > > > > > > > > wind station > 0 > 1234 > > > 0 > 0 > 0 > 0 > > > 0 > 0 > 0 > 0 > > > > > > > > > Thank you! > > Indu > > -----Original Message----- > From: David Thompson [mailto:david.thompson at kitware.com] > Sent: Thursday, June 25, 2015 5:31 PM > To: Shukla, Indu ERDC-RDE-ITL-MS > Cc: Yumin Yuan; smtk-developers at smtk.org; Hines, Amanda M ERDC-RDE-ITL-MS > Subject: Re: [Smtk-developers] Help > > Hi Indu, > >> ... >> att = asys.findAttribute('Globals?) >> gr = att.findString('ProjectName') >> gr = att.findGroup('ProjectInformation') >> gr.find('ProjectName') >> >> Please let me know how can I access the value of my ProjectName. > > The issue is that the "find" methods return a Python object that corresponds to the base "Item" type (which does not have methods to fetch data since no data format is specified in base class). The base Item must be converted to one of the proper type (StringItem in this case), which is done with smtk.attribute.to_concrete(). Either of these should work: > > 1. Fetch each item in the hierarchy > > att = asys.findAttribute('Globals') > gr = att.findGroup('ProjectInformation') > nm = smtk.attribute.to_concrete(gr.find('ProjectName')) > print nm.value(0) > > 2. If you have a *really* recent SMTK (fetched within the last few days), you can do this: > > att = asys.findAttribute('Globals') > nm = smtk.attribute.to_concrete( > att.itemAtPath('ProjectInformation/ProjectName', '/')) > print nm.value(0) > > where the '/' argument to "itemAtPath" is a separator character that divides the first argument into the list of items to descend. > > There appears to be a bug in the variant of att.find() that takes a smtk.attribute.SearchStyle as its second argument or there would be a third way. Hopefully one of the above will work for you until it is fixed. > > David -------------- next part -------------- A non-text attachment was scrubbed... Name: test.sbi Type: application/octet-stream Size: 49858 bytes Desc: test.sbi URL: From david.thompson at kitware.com Fri Jun 26 16:37:20 2015 From: david.thompson at kitware.com (David Thompson) Date: Fri, 26 Jun 2015 16:37:20 -0400 Subject: [Smtk-developers] Help In-Reply-To: References: <38E3416D-EE69-48C0-ADF5-116825F7CBE2@kitware.com> <9FC775EB-A160-4F57-9D79-9A5FD828D9DB@kitware.com> <9B9AEF6E-5BF3-4DCE-B0A6-C9F9139F6132@kitware.com> <9BA62D55-7D5B-4C63-94F0-2F20AA720D27@kitware.com> Message-ID: Hi Indu, > Tide and wind and the tabular entries in my form. There will be no fixed number of entries for tide and wind, they can vary according to the situation. In this test example I sent you, I only have one each for tide (Tide-0) and wind (Wind-0). > I need to know, > 1. How many of tide entries are there > 2. How many wind entries are there. tideAtts = asys.findAttributes('Tide') windAtts = asys.findAttributes('Wind') print len(tideAtts) print len(windAtts) You can then run "for tideAtt in tideAtts:" to process each tide or wind attribute in the returned list. > 3. Then access the items(Gage Station,{Station,Agency,Station ID}) and its values (Gage Station,{station,0,1234}) of each tide and wind entries. Access to these items is as in the previous e-mail, except that you can access items by their integer position in the attribute: smtk.attribute.to_concrete(smtk.attribute.to_concrete(tideAtts[0].item(0)).item(0)).name() smtk.attribute.to_concrete(smtk.attribute.to_concrete(tideAtts[0].item(0)).item(0)).value(0) David From david.thompson at kitware.com Mon Jun 29 16:03:08 2015 From: david.thompson at kitware.com (David Thompson) Date: Mon, 29 Jun 2015 16:03:08 -0400 Subject: [Smtk-developers] Attribute question Message-ID: <193F886B-628F-421A-BE51-6E1684D66F8C@kitware.com> Hi all, I am writing an SMTK attribute template for an interactive simulation and have a question about views. I have a view named "Scene" that contains camera and lighting parameters. There are both global parameters and per-light parameters. I would like to allow an arbitrary number of lights to be created and have them displayed in the "Scene" view below the global parameters. Is it possible to have both instanced and singleton attributes in the the same view? Thanks, David PS. To be more clear, I would like to include the "Light" tab (2nd screenshot) into the "Scene" tab (1st screenshot). -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2015-06-29 at 3.59.05 PM.png Type: image/png Size: 66755 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2015-06-29 at 3.59.54 PM.png Type: image/png Size: 59790 bytes Desc: not available URL: From bob.obara at kitware.com Mon Jun 29 16:15:28 2015 From: bob.obara at kitware.com (Robert Michael O'Bara) Date: Mon, 29 Jun 2015 16:15:28 -0400 Subject: [Smtk-developers] Attribute question In-Reply-To: <193F886B-628F-421A-BE51-6E1684D66F8C@kitware.com> References: <193F886B-628F-421A-BE51-6E1684D66F8C@kitware.com> Message-ID: <4154C951-C60E-4DA3-AF84-1FBF43D18A4B@kitware.com> Yes - If you specify Style=Tiled in the group view - you would get the children views to be tiled instead of tabbed. Bob Robert M. O'Bara, MEng. Assistant Director of Scientific Computing Kitware Inc. 28 Corporate Drive Suite 101 Clifton Park, NY 12065 Phone: (518) 881- 4931 > On Jun 29, 2015, at 4:03 PM, David Thompson wrote: > > Hi all, > > I am writing an SMTK attribute template for an interactive simulation and have a question about views. > > I have a view named "Scene" that contains camera and lighting parameters. There are both global parameters and per-light parameters. I would like to allow an arbitrary number of lights to be created and have them displayed in the "Scene" view below the global parameters. > > Is it possible to have both instanced and singleton attributes in the the same view? > > Thanks, > David > > PS. To be more clear, I would like to include the "Light" tab (2nd screenshot) into the "Scene" tab (1st screenshot). > > > _______________________________________________ > Smtk-developers mailing list > Smtk-developers at smtk.org > http://public.kitware.com/mailman/listinfo/smtk-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.thompson at kitware.com Mon Jun 29 18:05:36 2015 From: david.thompson at kitware.com (David Thompson) Date: Mon, 29 Jun 2015 18:05:36 -0400 Subject: [Smtk-developers] Attribute question In-Reply-To: <4154C951-C60E-4DA3-AF84-1FBF43D18A4B@kitware.com> References: <193F886B-628F-421A-BE51-6E1684D66F8C@kitware.com> <4154C951-C60E-4DA3-AF84-1FBF43D18A4B@kitware.com> Message-ID: <1BD61672-826C-401C-800A-9567245D21CB@kitware.com> > Yes - If you specify Style=Tiled in the group view - you would get the children views to be tiled instead of tabbed. Thanks, that worked! I didn't know about the Group view either, so double bonus! David > >> On Jun 29, 2015, at 4:03 PM, David Thompson wrote: >> >> Hi all, >> >> I am writing an SMTK attribute template for an interactive simulation and have a question about views. >> >> I have a view named "Scene" that contains camera and lighting parameters. There are both global parameters and per-light parameters. I would like to allow an arbitrary number of lights to be created and have them displayed in the "Scene" view below the global parameters. >> >> Is it possible to have both instanced and singleton attributes in the the same view? >> >> Thanks, >> David >> >> PS. To be more clear, I would like to include the "Light" tab (2nd screenshot) into the "Scene" tab (1st screenshot). >> >> >> _______________________________________________ >> Smtk-developers mailing list >> Smtk-developers at smtk.org >> http://public.kitware.com/mailman/listinfo/smtk-developers > From yumin.yuan at kitware.com Mon Jun 29 18:11:24 2015 From: yumin.yuan at kitware.com (Yumin Yuan) Date: Mon, 29 Jun 2015 18:11:24 -0400 Subject: [Smtk-developers] Attribute question In-Reply-To: <1BD61672-826C-401C-800A-9567245D21CB@kitware.com> References: <193F886B-628F-421A-BE51-6E1684D66F8C@kitware.com> <4154C951-C60E-4DA3-AF84-1FBF43D18A4B@kitware.com> <1BD61672-826C-401C-800A-9567245D21CB@kitware.com> Message-ID: You can also do group view of group view :). Here is an example of that from "ProteusPoisson.sbt" in cmb that Andy created ModelName analyticalSolution Coefficients dummyInitialCondition Physics Time??? Sparse Diffusion Tensors LevelModelType bcsTimeDependent BoundaryCondition initialCondition gridalternate Yumin On Mon, Jun 29, 2015 at 6:05 PM, David Thompson wrote: > > Yes - If you specify Style=Tiled in the group view - you would get the > children views to be tiled instead of tabbed. > > Thanks, that worked! I didn't know about the Group view either, so double > bonus! > > David > > > > >> On Jun 29, 2015, at 4:03 PM, David Thompson > wrote: > >> > >> Hi all, > >> > >> I am writing an SMTK attribute template for an interactive simulation > and have a question about views. > >> > >> I have a view named "Scene" that contains camera and lighting > parameters. There are both global parameters and per-light parameters. I > would like to allow an arbitrary number of lights to be created and have > them displayed in the "Scene" view below the global parameters. > >> > >> Is it possible to have both instanced and singleton attributes in the > the same view? > >> > >> Thanks, > >> David > >> > >> PS. To be more clear, I would like to include the "Light" tab (2nd > screenshot) into the "Scene" tab (1st screenshot). > >> > >> 3.59.54 PM.png> > >> _______________________________________________ > >> Smtk-developers mailing list > >> Smtk-developers at smtk.org > >> http://public.kitware.com/mailman/listinfo/smtk-developers > > > > _______________________________________________ > Smtk-developers mailing list > Smtk-developers at smtk.org > http://public.kitware.com/mailman/listinfo/smtk-developers > -------------- next part -------------- An HTML attachment was scrubbed... URL: