EESchema: BOM generation scripts crash on reference designators with decimals
Description
Attempt to generate Bill of materials with References like "K1.1", "K1.2" fails. Instead it should succeed with excluding such items from the result.
It is common practice(at least in Russia) to reference contact groups of relay "K1" as "K1.1", "K1.2", "K1.3" and so on. So, the relay coil has a value, is referenced as "K1" and listed in the resulting BOM. No need in including contact groups as items.
Steps to reproduce
Create an item in EESchema, set it's Reference value to something like "U2.5", "K1.1", etc. The thing is it should contain a decimal number. Invoke "Generate bill of materials". Select "bom_csv_grouped_by_value" plugin(since it provides informative error message on crash). Press "Generate".
The process crashes, the error message ends with number format error in kicad_netlist_reader.py, e.g.:
ret.sort(key=lambda g: f(g.getRef()))
File "C:\Common\Shitware\KiCad\bin\scripting\plugins/kicad_netlist_reader.py", line 623, in f
return re.sub(r'([A-z]+)[0-9]+', r'\1', v) + '%08i' % int(re.sub(r'[A-z]+([0-9]+)', r'\1', v))
ValueError: invalid literal for int() with base 10: '3.1'
The other BOM plugins fail too, with less informative messages.
KiCad Version
Application: eeschema
Version: (5.1.2)-1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.68.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.61.1
Compiler: GCC 8.2.0 with C++ ABI 1013
Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON