Fortran-FOSS-Programmers / ford

Automatically generates FORtran Documentation from comments within the code.
https://forddocs.readthedocs.io
GNU General Public License v3.0
405 stars 131 forks source link

Problems with graphs: crash and truncated #598

Closed j-machacek closed 9 months ago

j-machacek commented 9 months ago

Hi all,

first of all, thank you very much for FORD!

I am trying to use FORD to create documentation for a large finite element code that we develop.

When enabling graphs, we run in the following error:

graphs.py:1483: TqdmWarning: Iterable length 1055 > 1000 but chunksize is not set. This may seriously degrade multiprocess performance. Set chunksize=1 or more.

In Ubuntu this leads to the process freezing while under Windows (11) this error causes FORD to crash.

I could quick-fix this issue by hard coding "njobs=1" in graphs.py. Obviously this is not a good solution for the "official" FORD version, but maybe you can fix this issue.

Doing so I am able to create the documentation. However, in cases where many dependencies exist, the resulting graphs are trunkated as shown in the example below.

image

Am I missing something in my settings? The Markdown configuration file I am using is below. I am grateful for any advice.

Thanks in advance, Jan

---
project: numgeo - code documentation
media_dir: ./assets
summary: ![numgeo](|media|numgeo-logo-text-2023-09-27.png)<br/><br/>
         Source code documentation for numgeo
favicon: ./assets/favicon.ico
author: Jan Machacek
src_dir: ./src
output_dir: ./doc
exclude_dir: ./validation
             ./user-windows
             ./user
             ./pynumgeo
             ./installation
             ./docs
exclude: **/metis_.f90
source: true
graph: true
graph_maxnodes: 100
graph_maxdepth: 3
graph_dir: ./doc/graph
sort: alpha
print_creation_date: true
display: public
         protected
---
ZedThree commented 9 months ago

Ah, we should probably set a value for chunksize, I guess 1 is probably ok. You can also set parallel: 0 to turn off the parallel processing of the graphs -- though of course this might be much slower!

Hmm, when the graphs are too big to fit properly, you're supposed to be able to pan and zoom, but that doesn't appear to be working.

j-machacek commented 9 months ago

Thanks for the fast reply.

I forgot to mention that I tried at first setting chunksize=1 but it did not work for me.

I had a look at your changes and applied them to my local installation of FORD to test them. The "help" button now functions again. Options to "zoom in" and "zoom out" now appear in graphs. However, it seems that they do not allow to "zoom" out in the required frame to make all content visible. Example:

This is the default view when I open the documentation: image

If I zoom out now, then I can see the following: image

If I drag the content to fit better to the screen, then I achieve the following: image

Now this is obvisouly an extreme example, but it also becomes relevant for smaller parts of the code with less dependencies. It also would be very nice if the default setting would be "zoomed out max" such that the entire graph is visible and that the user has to zoom in to the relevant part of the graph.

I'm sorry that I'm no help when it comes to coding - I simply have no knowledge in this stuff. All I can do is copy and paste what you have changed... ;-)

Once again, thank you!

ZedThree commented 9 months ago

Sorry for the slow update @j-machacek, I'm struggling to reproduce this. Is there any chance you could share a complete working example? If the real code is private, you could rename things and strip out the real code.

j-machacek commented 9 months ago

@ZedThree thanks for testing it with our source code and fixing the issue. I confirm that it now works as expected.