Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are the examples supposed to work? #2

Open
ghost opened this issue Dec 4, 2020 · 1 comment
Open

Are the examples supposed to work? #2

ghost opened this issue Dec 4, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 4, 2020

Just downloaded and "bash run_tests.sh" ran ok. Tried to run "python3.8 'Truss 1.py' and got

Traceback (most recent call last):
  File "Truss 1.py", line 16, in <module>
    s1.addNode(0, 0, fixity='pin')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/StructPy/structural_classes.py", line 138, in addNode
    node = self.__class__.NodeType(x, y, n=n, cost=cost, fixity=fixity)
AttributeError: type object 'Structure' has no attribute 'NodeType'

Poked around and in Truss1.py s1 is an instance of Structure. Grepped around and found 'NodeType' defined in a class called Truss but no reference to Truss in Truss1.py and s1 is certainly not a Truss, it's a Structure.

So I'm wondering if I am doing something wrong or if the examples are broken.

Thanks!

@BrianChevalier
Copy link
Owner

They were supposed to but I didn't update them after I made changes to how the rest of the code worked. The tests in docstrings and the tests in Unit Tests would be a better reference for using the other code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant