Opened 5 years ago

Last modified 3 years ago

#5999 assigned defect

icon generator does not work with classnames ending on numeral

Reported by: Dietmar Winkler Owned by: Martin Sjölund
Priority: blocker Milestone: 1.19.0
Component: Scripts Version: v1.16.0-dev
Keywords: Cc:

Description

When trying to generate the HTML help for the latest 4.0.0 MSL release I noticed that the generate_icons.py does not seem to like class names ending on a numeral. So you get an error for ObsoleteModelica4

 2020-06-05 23:53:01.154984 Generating SVGs for package(s) ['ObsoleteModelica4']
2020-06-05 23:53:01,194 - generate_icons.py - INFO - Loading package: ObsoleteModelica4
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.8/cProfile.py", line 196, in <module>
    main()
  File "/usr/lib/python3.8/cProfile.py", line 189, in main
    runctx(code, globs, None, options.outfile, options.sort)
  File "/usr/lib/python3.8/cProfile.py", line 19, in runctx
    return _pyprofile._Utils(Profile).runctx(statement, globals, locals,
  File "/usr/lib/python3.8/profile.py", line 62, in runctx
    prof.runctx(statement, globals, locals)
  File "/usr/lib/python3.8/cProfile.py", line 100, in runctx
    exec(cmd, globals, locals)
  File "/usr/bin/../share/doc/omc/testmodels/generate_icons.py", line 1335, in <module>
    sys.exit(main())
  File "/usr/bin/../share/doc/omc/testmodels/generate_icons.py", line 1279, in main
    logger.critical('Failed to load packages in %.1f seconds: %s' % (time.time()-t,omc.sendExpression('getErrorString()')))
  File "/home/dietmarw/.venv/ttws3/lib/python3.8/site-packages/OMPython/__init__.py", line 606, in sendExpression
    answer = OMTypedParser.parseString(result)
  File "/home/dietmarw/.venv/ttws3/lib/python3.8/site-packages/OMPython/OMTypedParser.py", line 120, in parseString
    return omcGrammar.parseString(string)[0]
  File "/home/dietmarw/.venv/ttws3/lib/python3.8/site-packages/pyparsing.py", line 1955, in parseString
    raise exc
  File "/home/dietmarw/.venv/ttws3/lib/python3.8/site-packages/pyparsing.py", line 3814, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pyparsing.ParseException: Expected end of text, found '4'  (at char 117), (line:2, col:38)

Unfortunately that error will cause also other icons from being generated.
Looking at https://build.openmodelica.org/Documentation/ObsoleteModelica3.html this is an issue that has been around for some time.

Change History (11)

comment:1 by Francesco Casella, 5 years ago

Milestone: Future1.17.0
Owner: changed from somebody to Adrian Pop
Status: newassigned

Maybe @adrpo could have a look at that, once the 1.16.0 release is out.

comment:2 by modelica@…, 5 years ago

I also noticed that newly introduced icons like Modelica.Clocked or Modelica.UsersGuide.ReleaseNotes.Version_4_0_0 are not generated at all when generating the HTML documentation for MSL v4.0.0.

comment:3 by Francesco Casella, 5 years ago

Priority: highblocker

I'll give this blocker priority so we try to get it done by the next release.

comment:4 by Martin Sjölund, 5 years ago

Which version of OMPython is this? https://github.com/OpenModelica/OMPython/commit/3b831377 should have fixed this

comment:5 by Dietmar Winkler, 5 years ago

$ pip freeze
beautifulsoup4==4.9.1
bs4==0.0.1
future==0.18.2
numpy==1.18.5
OMPython==3.1.2
pyparsing==2.4.7
pyzmq==19.0.1
soupsieve==2.0.1
svgwrite==1.4
zmq==0.0.0

comment:6 by Adrian Pop, 5 years ago

Should be fixed by PR: https://github.com/OpenModelica/OpenModelica/pull/950
whenever I can push it through the testsuite.

comment:7 by Adrian Pop, 5 years ago

The change is now in, please check if this works for you.

comment:8 by Adrian Pop, 5 years ago

Owner: changed from Adrian Pop to Martin Sjölund

Feedback from @dietmarw.

Next problem with the documentation generator. Trying to load "ObsoleteModelica4.mo" does not seem to work with: loadModel(ObsoleteModelica4);

2020-06-15 16:18:33,948 - generate_icons.py - CRITICAL - Failed to load packages in 0.1 seconds: Notification: You can install the requested package using one of the commands:
  installPackage(ObsoleteModelica4, "4.0.0-master", exactMatch=true)
  installPackage(ObsoleteModelica4).
Error: Failed to load package ObsoleteModelica4 (default) using MODELICAPATH /usr/bin/../lib/omlibrary:/home/dietmarw/.openmodelica/libraries/.

Renaming to "ObsoleteModelica4 4.0.0.mo" and then do a loadModel(ObsoleteModelica4, {relVersion}); where relVerson=4.0.0 did not work either.

comment:9 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Rescheduled to 1.18.0

comment:10 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

comment:11 by Francesco Casella, 3 years ago

Milestone: 1.19.0

1.18.0 blocker tickets moved to 1.19.0

Note: See TracTickets for help on using tickets.