Problem after HG update

I am having problems running my script after an HG update this morning:
In [1]: run simple.py from_Robert.py sfepy: error: required missing: ['filename_mesh'] sfepy: left over: ['E', '__builtins__', '__file__', 'tractionLoad', '__name__', 'lamb', 'mu', 'fileName_mesh', 'v', '__doc__']
<type 'exceptions.ValueError'> Traceback (most recent call last)
/home/ryan/siue/Research/SfePy/first_problem/simple.py in <module>() 100 101 if __name__ == '__main__': --> 102 main() 103 104
/home/ryan/siue/Research/SfePy/first_problem/simple.py in main() 85 other.extend( ['equations'] ) 86 ---> 87 conf = ProblemConf.from_file( filename_in, required, other ) 88 ## print conf 89 ## pause()
/home/ryan/svn/sfepy/sfepy/base/conf.py in from_file(filename, required, other) 155 obj.__dict__.update( define_dict ) 156 --> 157 other_missing = obj.validate( required = required, other = other ) 158 for name in other_missing: 159 setattr( obj, name, None )
/home/ryan/svn/sfepy/sfepy/base/conf.py in validate(self, required, other) 218 219 if err: --> 220 raise ValueError 221 222 return other_missing
<type 'exceptions.ValueError'>: WARNING: Failure executing file: <simple.py>
In [2]: %debug
/home/ryan/svn/sfepy/sfepy/base/conf.py(220)validate()
219 if err:
--> 220 raise ValueError 221
The files I am trying to use are attached.
Thanks,
Ryan

Hi Ryan,
I have already wanted to ask you how you are doing... :)
The problem you see is caused by changing SfePy naming conventions to follow PEP 8, see 'new coding style' message to this list.
Just rename 'fileName_mesh' to 'filename_mesh' in your input file.
You can use './script/edit_identifiers.py <files>' if you have more files, just not that the automatic conversion is not perfect, sometimes (really not often) it edits too much.
r.
Ryan Krauss wrote:
I am having problems running my script after an HG update this morning:
In [1]: run simple.py from_Robert.py sfepy: error: required missing: ['filename_mesh'] sfepy: left over: ['E', '__builtins__', '__file__', 'tractionLoad', '__name__', 'lamb', 'mu', 'fileName_mesh', 'v', '__doc__']
<type 'exceptions.ValueError'> Traceback (most recent call last)
/home/ryan/siue/Research/SfePy/first_problem/simple.py in <module>() 100 101 if __name__ == '__main__': --> 102 main() 103 104
/home/ryan/siue/Research/SfePy/first_problem/simple.py in main() 85 other.extend( ['equations'] ) 86 ---> 87 conf = ProblemConf.from_file( filename_in, required, other ) 88 ## print conf 89 ## pause()
/home/ryan/svn/sfepy/sfepy/base/conf.py in from_file(filename, required, other) 155 obj.__dict__.update( define_dict ) 156 --> 157 other_missing = obj.validate( required = required, other = other ) 158 for name in other_missing: 159 setattr( obj, name, None )
/home/ryan/svn/sfepy/sfepy/base/conf.py in validate(self, required, other) 218 219 if err: --> 220 raise ValueError 221 222 return other_missing
<type 'exceptions.ValueError'>: WARNING: Failure executing file: <simple.py>
In [2]: %debug
/home/ryan/svn/sfepy/sfepy/base/conf.py(220)validate()
219 if err:
--> 220 raise ValueError 221
The files I am trying to use are attached.
Thanks,
Ryan

Thanks. Yeah, I see that the problems are all coming from my input script. User error I guess. I see a few other similar errors and will try the conversion script.
I am freaking out a bit that papers for SciPy are due a week from tomorrow. But I have been making some progress reading a really good book:
@book{CookBook, author = {Robert D. Cook and David S. Malkus and Michael E. Plesha and Robert J. Witt}, title = {Concepts and Applications of Finite Element Analysis}, year = {2002}, isbn = {0471356050}, publisher = {John Wiley \& Sons}, }
I think I now understand the difference between a weak and a strong formulation and how to get a matrix equation from a potential energy functional. Now I need to try a simple SfePy problem and make sure I understand it. Then I need to create a simulation with two bodies (giving SfePy multi-body dynamics capabilities), write algorithms to detect contact, and get a nonlinear material model working that incorporates large deformations and yielding.
So, I am obviously not going to be as far as I would like when the paper is due. But I would like to have a good chunk of it done before my presentation at the conference so I don't embarrass myself. The good news is that my summer class is done (once I submit my grades) and I can work on this pretty much full time until SciPy.
Ryan
On Thu, Jul 31, 2008 at 7:41 AM, Robert Cimrman cimr...@ntc.zcu.cz wrote:
Hi Ryan,
I have already wanted to ask you how you are doing... :)
The problem you see is caused by changing SfePy naming conventions to follow PEP 8, see 'new coding style' message to this list.
Just rename 'fileName_mesh' to 'filename_mesh' in your input file.
You can use './script/edit_identifiers.py <files>' if you have more files, just not that the automatic conversion is not perfect, sometimes (really not often) it edits too much.
r.
Ryan Krauss wrote:
I am having problems running my script after an HG update this morning:
In [1]: run simple.py from_Robert.py sfepy: error: required missing: ['filename_mesh'] sfepy: left over: ['E', '__builtins__', '__file__', 'tractionLoad', '__name__', 'lamb', 'mu', 'fileName_mesh', 'v', '__doc__']
<type 'exceptions.ValueError'> Traceback (most recent call last)
/home/ryan/siue/Research/SfePy/first_problem/simple.py in <module>() 100 101 if __name__ == '__main__': --> 102 main() 103 104
/home/ryan/siue/Research/SfePy/first_problem/simple.py in main() 85 other.extend( ['equations'] ) 86 ---> 87 conf = ProblemConf.from_file( filename_in, required, other ) 88 ## print conf 89 ## pause()
/home/ryan/svn/sfepy/sfepy/base/conf.py in from_file(filename, required, other) 155 obj.__dict__.update( define_dict ) 156 --> 157 other_missing = obj.validate( required = required, other = other ) 158 for name in other_missing: 159 setattr( obj, name, None )
/home/ryan/svn/sfepy/sfepy/base/conf.py in validate(self, required, other) 218 219 if err: --> 220 raise ValueError 221 222 return other_missing
<type 'exceptions.ValueError'>: WARNING: Failure executing file: <simple.py>
In [2]: %debug
/home/ryan/svn/sfepy/sfepy/base/conf.py(220)validate()
219 if err:
--> 220 raise ValueError 221
The files I am trying to use are attached.
Thanks,
Ryan

It seems like the edit_identifiers.py script worked. My code executed without error. edit_identifiers.py also said it found 218 candidates, so I would have been at it a long time editing by hand.
Thanks,
Ryan
On Thu, Jul 31, 2008 at 7:49 AM, Ryan Krauss ryan...@gmail.com wrote:
Thanks. Yeah, I see that the problems are all coming from my input script. User error I guess. I see a few other similar errors and will try the conversion script.
I am freaking out a bit that papers for SciPy are due a week from tomorrow. But I have been making some progress reading a really good book:
@book{CookBook, author = {Robert D. Cook and David S. Malkus and Michael E. Plesha and Robert J. Witt}, title = {Concepts and Applications of Finite Element Analysis}, year = {2002}, isbn = {0471356050}, publisher = {John Wiley \& Sons}, }
I think I now understand the difference between a weak and a strong formulation and how to get a matrix equation from a potential energy functional. Now I need to try a simple SfePy problem and make sure I understand it. Then I need to create a simulation with two bodies (giving SfePy multi-body dynamics capabilities), write algorithms to detect contact, and get a nonlinear material model working that incorporates large deformations and yielding.
So, I am obviously not going to be as far as I would like when the paper is due. But I would like to have a good chunk of it done before my presentation at the conference so I don't embarrass myself. The good news is that my summer class is done (once I submit my grades) and I can work on this pretty much full time until SciPy.
Ryan
On Thu, Jul 31, 2008 at 7:41 AM, Robert Cimrman cimr...@ntc.zcu.cz wrote:
Hi Ryan,
I have already wanted to ask you how you are doing... :)
The problem you see is caused by changing SfePy naming conventions to follow PEP 8, see 'new coding style' message to this list.
Just rename 'fileName_mesh' to 'filename_mesh' in your input file.
You can use './script/edit_identifiers.py <files>' if you have more files, just not that the automatic conversion is not perfect, sometimes (really not often) it edits too much.
r.
Ryan Krauss wrote:
I am having problems running my script after an HG update this morning:
In [1]: run simple.py from_Robert.py sfepy: error: required missing: ['filename_mesh'] sfepy: left over: ['E', '__builtins__', '__file__', 'tractionLoad', '__name__', 'lamb', 'mu', 'fileName_mesh', 'v', '__doc__']
<type 'exceptions.ValueError'> Traceback (most recent call last)
/home/ryan/siue/Research/SfePy/first_problem/simple.py in <module>() 100 101 if __name__ == '__main__': --> 102 main() 103 104
/home/ryan/siue/Research/SfePy/first_problem/simple.py in main() 85 other.extend( ['equations'] ) 86 ---> 87 conf = ProblemConf.from_file( filename_in, required, other ) 88 ## print conf 89 ## pause()
/home/ryan/svn/sfepy/sfepy/base/conf.py in from_file(filename, required, other) 155 obj.__dict__.update( define_dict ) 156 --> 157 other_missing = obj.validate( required = required, other = other ) 158 for name in other_missing: 159 setattr( obj, name, None )
/home/ryan/svn/sfepy/sfepy/base/conf.py in validate(self, required, other) 218 219 if err: --> 220 raise ValueError 221 222 return other_missing
<type 'exceptions.ValueError'>: WARNING: Failure executing file: <simple.py>
In [2]: %debug
/home/ryan/svn/sfepy/sfepy/base/conf.py(220)validate()
219 if err:
--> 220 raise ValueError 221
The files I am trying to use are attached.
Thanks,
Ryan

Ryan Krauss wrote:
It seems like the edit_identifiers.py script worked. My code executed
Good to hear that.
without error. edit_identifiers.py also said it found 218 candidates, so I would have been at it a long time editing by hand.
It uses a sort of two-pass approach, so the reported number is just a number of edits it attempted, not the actual number of changes required, which is usually much smaller. If you re-run the script, this number is going to stay the same even if no changes would be made.
r.

On Thu, Jul 31, 2008 at 2:49 PM, Ryan Krauss ryan...@gmail.com wrote:
Thanks. Yeah, I see that the problems are all coming from my input script. User error I guess. I see a few other similar errors and will try the conversion script.
I am freaking out a bit that papers for SciPy are due a week from tomorrow. But I have been making some progress reading a really good book:
The same with me and a sympy paper. :)
Ondrej

Ryan Krauss wrote:
Thanks. Yeah, I see that the problems are all coming from my input script. User error I guess. I see a few other similar errors and will try the conversion script.
Well, we have made a backwards incompatible change. Such changes are going to happen from time to time, as the code matures. I will try to provide conversion tools, though, so that it is as painless as possible.
I am freaking out a bit that papers for SciPy are due a week from tomorrow. But I have been making some progress reading a really good book:
@book{CookBook, author = {Robert D. Cook and David S. Malkus and Michael E. Plesha and Robert J. Witt}, title = {Concepts and Applications of Finite Element Analysis}, year = {2002}, isbn = {0471356050}, publisher = {John Wiley \& Sons}, }
a real cookbook...
I think I now understand the difference between a weak and a strong formulation and how to get a matrix equation from a potential energy functional. Now I need to try a simple SfePy problem and make sure I understand it. Then I need to create a simulation with two bodies (giving SfePy multi-body dynamics capabilities), write algorithms to detect contact, and get a nonlinear material model working that incorporates large deformations and yielding.
I would start with the nonlinear material model + large deformations - I think we could make it work pretty quickly (in some form). At first, the contact can be modeled just by prescribing displacements.
So, I am obviously not going to be as far as I would like when the paper is due. But I would like to have a good chunk of it done before my presentation at the conference so I don't embarrass myself. The good news is that my summer class is done (once I submit my grades) and I can work on this pretty much full time until SciPy.
I should be available to support you till about august 14 (exception: august 8, Iron Maiden in Prague...), when I am going to take my summer vacation (hiking in mountains) for a little bit more than one week. I am also starting to prepare some reconstruction in my flat, so I may be occasionally late in answering even before the date.
r.

I am fine with starting with the material model. Can you point me to the right spot in the code to start looking.
On Thu, Jul 31, 2008 at 8:13 AM, Robert Cimrman cimr...@ntc.zcu.cz wrote:
Ryan Krauss wrote:
Thanks. Yeah, I see that the problems are all coming from my input script. User error I guess. I see a few other similar errors and will try the conversion script.
Well, we have made a backwards incompatible change. Such changes are going to happen from time to time, as the code matures. I will try to provide conversion tools, though, so that it is as painless as possible.
I am freaking out a bit that papers for SciPy are due a week from tomorrow. But I have been making some progress reading a really good book:
@book{CookBook, author = {Robert D. Cook and David S. Malkus and Michael E. Plesha and Robert J. Witt}, title = {Concepts and Applications of Finite Element Analysis}, year = {2002}, isbn = {0471356050}, publisher = {John Wiley \& Sons}, }
a real cookbook...
I think I now understand the difference between a weak and a strong formulation and how to get a matrix equation from a potential energy functional. Now I need to try a simple SfePy problem and make sure I understand it. Then I need to create a simulation with two bodies (giving SfePy multi-body dynamics capabilities), write algorithms to detect contact, and get a nonlinear material model working that incorporates large deformations and yielding.
I would start with the nonlinear material model + large deformations - I think we could make it work pretty quickly (in some form). At first, the contact can be modeled just by prescribing displacements.
So, I am obviously not going to be as far as I would like when the paper is due. But I would like to have a good chunk of it done before my presentation at the conference so I don't embarrass myself. The good news is that my summer class is done (once I submit my grades) and I can work on this pretty much full time until SciPy.
I should be available to support you till about august 14 (exception: august 8, Iron Maiden in Prague...), when I am going to take my summer vacation (hiking in mountains) for a little bit more than one week. I am also starting to prepare some reconstruction in my flat, so I may be occasionally late in answering even before the date.
r.

Ryan Krauss wrote:
I am fine with starting with the material model. Can you point me to the right spot in the code to start looking.
Look at sfepy/terms/termsLinElasticity.py, and input/le.py to see how the linear elasticity terms are implemented/used.
Put some prints + pauses into LinearElasticTerm.__call__(), or use debug() to explore the namespace. Note that 'print <var>' reveals more than typing just <var> at the pdb prompt.
When using debug(), always press 'n' to get to the caller frame, i.e. the function you called debug() from.
r.

Thanks. I will start there.
On Thu, Jul 31, 2008 at 8:54 AM, Robert Cimrman cimr...@ntc.zcu.cz wrote:
Ryan Krauss wrote:
I am fine with starting with the material model. Can you point me to the right spot in the code to start looking.
Look at sfepy/terms/termsLinElasticity.py, and input/le.py to see how the linear elasticity terms are implemented/used.
Put some prints + pauses into LinearElasticTerm.__call__(), or use debug() to explore the namespace. Note that 'print <var>' reveals more than typing just <var> at the pdb prompt.
When using debug(), always press 'n' to get to the caller frame, i.e. the function you called debug() from.
r.

BTW, you may also come to IRC to #sfepy at freenode.
Robert is there each working day. I am there all the time. :) Then we can help you much faster.
Ondrej

It seems that one issue is that 'filename_mesh' has a capital N in some places and not others:
ipdb> missing = [item for item in required if not hasattr(self, item)] ipdb> missing ['filename_mesh', 'field_[0-9]+|fields', 'ebc_[0-9]+|ebcs', 'region_[0-9]+|regions', 'variable_[0-9]+|variables', 'material_[0-9]+|materials', 'integral_[0-9]+|integrals', 'solver_[0-9]+|solvers'] ipdb> hasattr(self, 'filename_mesh') False ipdb> self.fi self.field_1 self.fileName_mesh ipdb> self.fileName_mesh 'first_mesh.1.node'
On Thu, Jul 31, 2008 at 7:36 AM, Ryan Krauss ryan...@gmail.com wrote:
I am having problems running my script after an HG update this morning:
In [1]: run simple.py from_Robert.py sfepy: error: required missing: ['filename_mesh'] sfepy: left over: ['E', '__builtins__', '__file__', 'tractionLoad', '__name__', 'lamb', 'mu', 'fileName_mesh', 'v', '__doc__']
<type 'exceptions.ValueError'> Traceback (most recent call last)
/home/ryan/siue/Research/SfePy/first_problem/simple.py in <module>() 100 101 if __name__ == '__main__': --> 102 main() 103 104
/home/ryan/siue/Research/SfePy/first_problem/simple.py in main() 85 other.extend( ['equations'] ) 86 ---> 87 conf = ProblemConf.from_file( filename_in, required, other ) 88 ## print conf 89 ## pause()
/home/ryan/svn/sfepy/sfepy/base/conf.py in from_file(filename, required, other) 155 obj.__dict__.update( define_dict ) 156 --> 157 other_missing = obj.validate( required = required, other = other ) 158 for name in other_missing: 159 setattr( obj, name, None )
/home/ryan/svn/sfepy/sfepy/base/conf.py in validate(self, required, other) 218 219 if err: --> 220 raise ValueError 221 222 return other_missing
<type 'exceptions.ValueError'>: WARNING: Failure executing file: <simple.py>
In [2]: %debug
/home/ryan/svn/sfepy/sfepy/base/conf.py(220)validate()
219 if err: --> 220 raise ValueError 221
The files I am trying to use are attached.
Thanks,
Ryan
participants (3)
-
Ondrej Certik
-
Robert Cimrman
-
Ryan Krauss