Python Forum
TypeError: size; expecting a recognized type filling string dict
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  You have any idea, how fix TypeError: unhashable type: 'list' lsepolis123 2 262 Jun-02-2021, 07:55 AM
Last Post: supuflounder
  TypeError: int() argument must be a string, a bytes-like object or a number, not 'Non Anldra12 2 485 May-02-2021, 03:45 PM
Last Post: Anldra12
  TypeError: __str__ returned non-string (type tuple) Anldra12 1 644 Apr-13-2021, 07:50 AM
Last Post: Anldra12
  What type of *data* is the name of a list/tuple/dict, etc? alloydog 9 746 Jan-30-2021, 07:11 AM
Last Post: alloydog
Question dict value, how to change type from int to list? swissjoker 3 540 Dec-09-2020, 09:50 AM
Last Post: perfringo
  Pyspark SQL Error - mismatched input 'FROM' expecting <EOF> Ariean 3 5,713 Nov-20-2020, 03:49 PM
Last Post: Ariean
  [SOLVED] Filling multidict from CSV file? Winfried 3 362 Oct-24-2020, 08:26 PM
Last Post: Winfried
  TypeError: string indices must be integers hendern 2 731 Oct-02-2020, 10:16 PM
Last Post: hendern
  TypeError: 'type' object is not subscriptable Stef 1 1,045 Aug-28-2020, 03:01 PM
Last Post: Gribouillis
  String index out of bounds ( Python : Dict ) kommu 2 704 Jun-25-2020, 08:52 PM
Last Post: menator01

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020