Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ford.graphs.BadType: "Unrecognised object type 'str' for object 'bias_corr' when constructing graphs" #493

Closed
blaylockbk opened this issue Mar 22, 2023 · 2 comments 路 Fixed by #494

Comments

@blaylockbk
Copy link
Contributor

Ford is awesome 馃帀 Thanks for building and maintaining this.

I'm creating FORD docs for a rather large and complex code base. The docs build fine when graph: false, but when graph: true I run into the following error.

Creating HTML documentation...
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\blaylock\AppData\Local\miniconda3\envs\fortran-docs\Scripts\ford.exe\__main__.py", line 7, in <module>
  File "C:\Users\blaylock\AppData\Local\miniconda3\envs\fortran-docs\Lib\site-packages\ford\__init__.py", line 646, in run
    main(proj_data, proj_docs, md)
  File "C:\Users\blaylock\AppData\Local\miniconda3\envs\fortran-docs\Lib\site-packages\ford\__init__.py", line 630, in main
    docs = ford.output.Documentation(proj_data, proj_docs_, project, page_tree)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\blaylock\AppData\Local\miniconda3\envs\fortran-docs\Lib\site-packages\ford\output.py", line 158, in __init__
    self.graphs.register(item)
  File "C:\Users\blaylock\AppData\Local\miniconda3\envs\fortran-docs\Lib\site-packages\ford\graphs.py", line 1267, in register
    self.data.register(obj)
  File "C:\Users\blaylock\AppData\Local\miniconda3\envs\fortran-docs\Lib\site-packages\ford\graphs.py", line 194, in register
    collection[obj] = NodeType(obj, self, hist)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\blaylock\AppData\Local\miniconda3\envs\fortran-docs\Lib\site-packages\ford\graphs.py", line 415, in __init__
    n = gd.get_node(u)
        ^^^^^^^^^^^^^^
  File "C:\Users\blaylock\AppData\Local\miniconda3\envs\fortran-docs\Lib\site-packages\ford\graphs.py", line 212, in get_node
    collection, _ = self._get_collection_and_node_type(obj)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\blaylock\AppData\Local\miniconda3\envs\fortran-docs\Lib\site-packages\ford\graphs.py", line 172, in _get_collection_and_node_type
    raise BadType(
ford.graphs.BadType: "Unrecognised object type 'str' for object 'bias_corr' when constructing graphs"

I think this error means the module it is trying to make a graph for does not exists as far as FORD is concerned (how/where that module is linked during compile is still a mystery to me).

Perhaps with this kind of error FORD could throw a warning instead and skip making a graph for items like this.

For now, I bypassed the error by excluding the files and dirs that use that module.

Thanks for your consideration.

@ZedThree
Copy link
Member

Thanks for the bug report @blaylockbk! If you're able, please could you see if #494 fixes things for you? If not, if you can point me at your project's source, I can try myself.

@blaylockbk
Copy link
Contributor Author

Thanks for the quick fix! This solved the error for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants