Comments (8)
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.
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.
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.
Hi @RichardWhitfield sorry for late reply. Can you please submit pull request?
from anastruct.
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.
@RichardWhitfield Can you upload your change here? Thank you.
from anastruct.
See attached zip file with load.py.
from anastruct.
@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)
- solve() error HOT 3
- Load Combination Bending Moment Diagram HOT 2
- Enriching the documentation HOT 6
- Why both SciPy and NumPy? (edit: help wanted to work around an upstream Numpy bug!) HOT 3
- Add an output for elemental _displacements_
- Element not rotating right when using springs at end of elements
- Overhanging members fail constitutive matrix
- Add meaningful error handling for non-integer node_ids (was: Solve error) HOT 3
- Overlaying displacement plots HOT 1
- find_node_id function error HOT 2
- How to insert moment releases on beam element?
- How to find element id HOT 1
- Moments found at internal hinges
- sectionbase data files missing
- Error when declaring supports: AttributeError: module 'collections' has no attribute 'Iterable' HOT 2
- Obtaining forces values HOT 1
- Make insert_node() not forget supports (was: Point load element) HOT 2
- incorrect bending moment in simple frame with point load HOT 1
- Bug with ss.q_load() when specifying a direction HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anastruct.