Giter VIP home page Giter VIP logo

Comments (8)

scote89 avatar scote89 commented on June 24, 2024

same issue here...

running the exact same https://anastruct.readthedocs.io/en/latest/loadcases.html#load-cases-and-load-combinations example, we get the following error:

Loadcase wind:
{'q_load-1': {'direction': 'element',
              'element_id': [10, 11, 12, 13, 5],
              'q': [[(-1, -1)]]}}
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
C:\Users\\AppData\Local\Temp/ipykernel_73584/1884868986.py in <module>
     25 
     26 # add the load case to the SystemElements object
---> 27 ss.apply_load_case(lc_wind)
     28 ss.show_structure()

C:\ProgramData\Anaconda3\lib\site-packages\anastruct\fem\system.py in apply_load_case(self, loadcase)
   1536             kwargs = re.sub(r".??(\w+).?:", r"\1=", kwargs)
   1537 
-> 1538             exec("self.{}({})".format(method, kwargs))
   1539 
   1540     def __deepcopy__(self, memo):

C:\ProgramData\Anaconda3\lib\site-packages\anastruct\fem\system.py in <module>

C:\ProgramData\Anaconda3\lib\site-packages\anastruct\fem\system.py in q_load(self, q, element_id, direction)
    922             id_ = _negative_index_to_id(element_id[i], self.element_map.keys())
    923             self.plotter.max_q = max(
--> 924                 self.plotter.max_q, max(abs(q[i][0]), abs(q[i][1]))
    925             )
    926             self.loads_q[id_] = [

TypeError: bad operand type for abs(): 'list'
```

from anastruct.

RichardWhitfield avatar RichardWhitfield commented on June 24, 2024

Also have the same issue. Looking into this a bit further it seems to be that Load Cases do not work with q_loads.

For v1.3 there is a line in System.py (line 912) which talks about duck typing hell in the method which seems to be the issue (so it's semi known). I'll have a look to see if there is an easy solution but I'm really not a Python programmer so don't hold your breath.

from anastruct.

RichardWhitfield avatar RichardWhitfield commented on June 24, 2024

Ok I believe I have solved this one. I have refactored the code in load.py so that the creation of q_load matches the format of q_load in system.py.

This passes all existing tests and I have added an additional test for this error which also passes. I can either post the code here or if someone would like to grant me permissions to push then I'm happy to submit a pull request or alternatively I'm also happy just to upload the changed file here. Let me know.

from anastruct.

wolinski avatar wolinski commented on June 24, 2024

Hi @RichardWhitfield sorry for late reply. Can you please submit pull request?

from anastruct.

RichardWhitfield avatar RichardWhitfield commented on June 24, 2024

Hi @wolinski, no worries I still have the code locally! I need permission to push my branch first and then I can create a pull request.

from anastruct.

warem-stu avatar warem-stu commented on June 24, 2024

@RichardWhitfield Can you upload your change here? Thank you.

from anastruct.

RichardWhitfield avatar RichardWhitfield commented on June 24, 2024

load.zip

See attached zip file with load.py.

from anastruct.

warem-stu avatar warem-stu commented on June 24, 2024

@RichardWhitfield Thanks for the file. I got the error followed. Can you help to have a look? Thank you.

Traceback (most recent call last):
File "C:\Roy\tools\msys64\home\roy.wu\bin\python3\anaStruct\LC.py", line 23, in <module> ss.apply_load_case(lc_wind) # this does NOT work
File "C:/Roy/tools/msys64/mingw32/lib/python3.10/site-packages/anastruct/fem/system.py", line 1543, in apply_load_case exec("self.{}({})".format(method, kwargs))
File "<string>", line 1, in <module>
TypeError: SystemElements.q_load() got an unexpected keyword argument 'rotation'

from anastruct.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.