Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 TypeError: size; expecting a recognized type filling string dict
#1
I have been working on Python script for Abaqus and it has to do with dynamic changes in the parameters of the model. The script opens up a .txt file and reads different values. The values are separated using tabs and I am using split() function of the Abaqus-Python to read the values properly once I have assigned them to a list.
The last index is [5] and it contains mesh size, again a float value. The structure is properly drawn in ABAQUS, the only error it throws me is while assigning the mesh size. It throws me the error listed above. So I tried using repr() to make it a string, but I was it will throw me that the input should be float/integer value and it did exactly the same. Now I am stuck and I can't work any further. I even tried to truncate the float value to 3-decimal points for the mesh size, but it would still throw the same error.
Any help is much appreciated, thanks a lot :)

What I am expecting is that it writes exactly how the mesh size must be written in the specified line. I don't understand what is the problem, because it is able to write the dimensions properly, the only problem comes while writing the float value of mesh size.

CODE:::

beamPart.setElementType(elemTypes=(ElemType(elemCode=B23, elemLibrary=STANDARD), ), regions=beam_mesh_region)
    beamPart.seedPart(deviationFactor=0.1, minSizeFactor=0.1, size=mesh)
In the above line, it throws me the error as shown in the thread :::
Error:
TypeError: size; found 'module', expecting a recognized type filling string dict
From what I know is, it always writes in 'module' - so the error has something to with size or the filling string dict.

The exact error looks like this:
Error:
File "C:\Users\ANANT\PycharmProjects\test_final\test_copy.py", line 104, in <module> beamPart.seedPart(deviationFactor=0.1, minSizeFactor=0.1, size=mesh) TypeError: size; found 'module', expecting a recognized type filling string dict
Thanks for the feedback, I shall keep that in mind hereafter.
buran wrote Feb-10-2020, 08:43 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.

Please, post the entire traceback that you get. We need to see the whole thing. Do not just give us the last line.
Take a time to read What to include in a post
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  dict elements are sometimes treated as List and sometimes as String phython_mdr 3 103 Yesterday, 01:16 AM
Last Post: deanhystad
  Change string into Dict Robin_at_Cantelli 2 848 Mar-05-2020, 10:37 AM
Last Post: vishalhule
  TypeError: type str doesn't define __round__ method emmapaw24 7 476 Feb-03-2020, 08:38 PM
Last Post: snippsat
  TypeError: can't multiply sequence by non-int of type 'str' emmapaw24 2 145 Feb-03-2020, 05:50 PM
Last Post: michael1789
  Type hinting - return type based on parameter micseydel 2 148 Jan-14-2020, 01:20 AM
Last Post: micseydel
  type of object as a string Skaperen 1 206 Dec-02-2019, 08:01 AM
Last Post: midarq
  TypeError: unsupported operand type(s) for -: 'str' and 'str' Balaji 4 1,501 Oct-11-2019, 10:29 AM
Last Post: buran
  size of set vs size of dict zweb 0 309 Oct-11-2019, 01:32 AM
Last Post: zweb
  [split] capitalize dict keys for display in string newbieAuggie2019 3 335 Oct-10-2019, 10:50 AM
Last Post: perfringo
  matplotlib isn't recognized after installation Pavel_47 5 219 Sep-18-2019, 07:01 PM
Last Post: snippsat

Forum Jump:


Users browsing this thread: 1 Guest(s)