Skip to content

Plotting: Array dims not matching, Reporting module: LoadCombo not being detected #268

@OjjoJR

Description

@OjjoJR

Describe the bug
Using the example:
Examples/Simple Beam - Point Load.py

There are 2 bugs:

Bug 1

simple_beam.members['M1'].plot_shear('Fy', '1.2D+1.6L')

produces the following error:

Traceback (most recent call last):
  File "[removed]", line 57, in <module>
    simple_beam.members['M1'].plot_shear('Fy', '1.2D+1.6L')
  File "[removed]\site-packages\Pynite\PhysMember.py", line 253, in plot_shear
    x_submember, V_submember = submember.shear_array(Direction, n_points, combo_name)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[removed]\site-packages\Pynite\Member3D.py", line 965, in shear_array
    return self._extract_vector_results(self.SegmentsZ, x_array, 'shear')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[removed]\site-packages\Pynite\Member3D.py", line 2278, in _extract_vector_results
    return vstack((x_array2, hstack(segment_results)))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[removed]\site-packages\numpy\_core\shape_base.py", line 292, in vstack
    return _nx.concatenate(arrs, 0, dtype=dtype, casting=casting)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 10 and the array at index 1 has size 20

Bug 2

I commented out the simple_beam.members['M1'].plot_ items, to try and use the reporting functionality.

Reporting.create_report(simple_beam, output_filepath='./Pynite Report.pdf', node_table=False, plate_table=False, plate_corner_forces=False, plate_center_forces=False, plate_corner_membrane=False, plate_center_membrane=False)

produces the following error:

Traceback (most recent call last):
  File "[removed]", line 80, in <module>
    Reporting.create_report(simple_beam, output_filepath=Path('./Pynite Report.pdf'), node_table=False, plate_table=False, plate_corner_forces=False, plate_center_forces=False, plate_corner_membrane=False, plate_center_membrane=False)
  File "[removed]\site-packages\Pynite\Reporting.py", line 68, in create_report
    HTML = template.render(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[removed]\site-packages\jinja2\environment.py", line 1295, in render
    self.environment.handle_exception()
  File "[removed]\site-packages\jinja2\environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "[removed]\site-packages\Pynite\Report_Template.html", line 210, in top-level template code
    <td>{{ "%.4g" | format(node.RxnFX[combo]) }}</td>
^^^^^^^^^
  File "[removed]\site-packages\jinja2\filters.py", line 1043, in do_format
    return soft_str(value) % (kwargs or args)
           ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
jinja2.exceptions.UndefinedError: dict object has no element <Pynite.LoadCombo.LoadCombo object at [memory address]>

To Reproduce
run Examples/Simple Beam - Point Load.py, with and without the simple_beam.members['M1'].plot_ items.

Expected behavior
plotting and reporting

Additional context
I'm guessing recent updates have changed the member arrays, affecting plotting. I'm not sure why the jinja report is not accessing load combinations properly, however.

Thanks for the help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions