Skip to content

[Bug]: Crash when trying to draw a big circuit #352

@A-bnk

Description

@A-bnk

liionpack Version

0.3.12

Python Version

3.10.12

Describe the bug

Hello, when invoking the draw_circuit method using a 3p96s battery pack, the script terminates with a runtime error

Traceback (most recent call last):
  File "/home/bnk/bat_models/pyBamm/circuit.py", line 28, in <module>
    lp.draw_circuit(net2, cpt_size=1.0, dpi=300, node_spacing=2.5)
  File "/home/bnk/.local/lib/python3.10/site-packages/liionpack/plots.py", line 144, in draw_circuit
    cct.draw(**kwargs)
  File "/home/bnk/.local/lib/python3.10/site-packages/lcapy/netlistmixin.py", line 839, in draw
    return cct.sch.draw(filename=filename, **kwargs)
  File "/home/bnk/.local/lib/python3.10/site-packages/lcapy/schematic.py", line 671, in draw
    self.tikz_draw(filename=filename,
  File "/home/bnk/.local/lib/python3.10/site-packages/lcapy/schematic.py", line 510, in tikz_draw
    raise RuntimeError('Could not generate %s with pdflatex' %
RuntimeError: Could not generate /tmp/tmpjsf1dcnr.pdf with pdflatex

Playing around witht the parameters like reducing dpi makes the script take a bit longer before terminating, which leds me to believe its probably a memory issue. I am currently using liionpack on Ubuntu 22.04 (WSL) if that makes a difference. My Host-PC has 32GB RAM, the WSL instance gets 16 GB, which should have been enough. Many thanks!

Steps to Reproduce

No response

Expected behaviour

No response

Relevant log output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions