Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit c24348f

Browse files
author
katta
committed
Bugfixes for documentation build (issues #305, 307)
- m2r & sphinx>=3.0 are not compatible (more info in pr in progress in m2r: miyakogi/m2r#55) - add path in conf.py to find the nmodl module - removed various doxygen warnings due to unacceptable keywords in configuration files - adjust checkparent_visitor sphinx autodoc /copybrief - reduce the maxium number of processors used to build documentation (it was freezing my workstation)
1 parent 25e654c commit c24348f

10 files changed

Lines changed: 26 additions & 43 deletions

File tree

.travis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ addons:
4343
- python3-pip
4444
- doxygen
4545
- pandoc
46+
- texlive-base
47+
- dvipng
4648
# for Mac builds, we use Homebrew
4749
homebrew:
4850
packages:
@@ -77,7 +79,13 @@ install:
7779
- pip3 install -U pip setuptools
7880
- pip3 install Jinja2 PyYAML pytest sympy --user
7981
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
80-
pip3 install -U --user sphinx nbsphinx>=0.3.2 m2r sphinx-rtd-theme jupyter;
82+
# there is a bug in m2r if sphinx>2.4.4. There is a pr in m2r to solve the
83+
# issue here: https://github.com/miyakogi/m2r/pull/55 . When it is done
84+
# I will remove the sphinx downgrade. Change setup.py requirements when it
85+
# be the case
86+
#
87+
# Katta
88+
pip3 install -U --user sphinx==2.4.4 nbsphinx>=0.3.2 m2r sphinx-rtd-theme jupyter;
8189
fi
8290

8391
#=============================================================================

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ repository:
107107
If you are developing NMODL, make sure to enable both `NMODL_FORMATTING` and `NMODL_PRECOMMIT`
108108
CMake variables to ensure that your contributions follow the coding conventions of this project:
109109

110-
```cmake
110+
```
111111
cmake -DNMODL_FORMATTING:BOOL=ON -DNMODL_PRECOMMIT:BOOL=ON <path>
112112
```
113113

docs/DoxygenLayout.xml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<doxygenlayout version="1.0">
22
<!-- Generated by doxygen 1.8.15 -->
3+
<!-- adapted to doxygen 1.8.13 (Katta) -->
34
<!-- Navigation index tabs for HTML output -->
45
<navindex>
56
<tab type="mainpage" visible="yes" title="Overview"/>
@@ -9,26 +10,12 @@
910
<tab type="namespacelist" visible="yes" title="" intro=""/>
1011
<tab type="namespacemembers" visible="yes" title="" intro=""/>
1112
</tab>
12-
<tab type="interfaces" visible="yes" title="">
13-
<tab type="interfacelist" visible="yes" title="" intro=""/>
14-
<tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
15-
<tab type="interfacehierarchy" visible="yes" title="" intro=""/>
16-
</tab>
1713
<tab type="classes" visible="yes" title="">
1814
<tab type="classlist" visible="yes" title="" intro=""/>
1915
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
2016
<tab type="hierarchy" visible="yes" title="" intro=""/>
2117
<tab type="classmembers" visible="yes" title="" intro=""/>
2218
</tab>
23-
<tab type="structs" visible="yes" title="">
24-
<tab type="structlist" visible="yes" title="" intro=""/>
25-
<tab type="structindex" visible="$ALPHABETICAL_INDEX" title=""/>
26-
</tab>
27-
<tab type="exceptions" visible="yes" title="">
28-
<tab type="exceptionlist" visible="yes" title="" intro=""/>
29-
<tab type="exceptionindex" visible="$ALPHABETICAL_INDEX" title=""/>
30-
<tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
31-
</tab>
3219
<tab type="files" visible="yes" title="">
3320
<tab type="filelist" visible="yes" title="" intro=""/>
3421
<tab type="globals" visible="yes" title="" intro=""/>
@@ -102,13 +89,8 @@
10289
<memberdecl>
10390
<nestednamespaces visible="yes" title=""/>
10491
<constantgroups visible="yes" title=""/>
105-
<interfaces visible="yes" title=""/>
10692
<classes visible="yes" title=""/>
107-
<structs visible="yes" title=""/>
108-
<exceptions visible="yes" title=""/>
10993
<typedefs title=""/>
110-
<sequences title=""/>
111-
<dictionaries title=""/>
11294
<enums title=""/>
11395
<functions title=""/>
11496
<variables title=""/>
@@ -117,8 +99,6 @@
11799
<memberdef>
118100
<inlineclasses title=""/>
119101
<typedefs title=""/>
120-
<sequences title=""/>
121-
<dictionaries title=""/>
122102
<enums title=""/>
123103
<functions title=""/>
124104
<variables title=""/>
@@ -135,16 +115,11 @@
135115
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
136116
<sourcelink visible="yes"/>
137117
<memberdecl>
138-
<interfaces visible="yes" title=""/>
139118
<classes visible="yes" title=""/>
140-
<structs visible="yes" title=""/>
141-
<exceptions visible="yes" title=""/>
142119
<namespaces visible="yes" title=""/>
143120
<constantgroups visible="yes" title=""/>
144121
<defines title=""/>
145122
<typedefs title=""/>
146-
<sequences title=""/>
147-
<dictionaries title=""/>
148123
<enums title=""/>
149124
<functions title=""/>
150125
<variables title=""/>
@@ -154,8 +129,6 @@
154129
<inlineclasses title=""/>
155130
<defines title=""/>
156131
<typedefs title=""/>
157-
<sequences title=""/>
158-
<dictionaries title=""/>
159132
<enums title=""/>
160133
<functions title=""/>
161134
<variables title=""/>
@@ -176,8 +149,6 @@
176149
<classes visible="yes" title=""/>
177150
<defines title=""/>
178151
<typedefs title=""/>
179-
<sequences title=""/>
180-
<dictionaries title=""/>
181152
<enums title=""/>
182153
<enumvalues title=""/>
183154
<functions title=""/>
@@ -196,8 +167,6 @@
196167
<inlineclasses title=""/>
197168
<defines title=""/>
198169
<typedefs title=""/>
199-
<sequences title=""/>
200-
<dictionaries title=""/>
201170
<enums title=""/>
202171
<enumvalues title=""/>
203172
<functions title=""/>

docs/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@
1717
# add these directories to sys.path here. If the directory is relative to the
1818
# documentation root, use os.path.abspath to make it absolute, like shown here.
1919
#
20+
21+
22+
2023
import os
2124
import subprocess
2225
import sys
2326
import textwrap
2427

28+
# The project needs to be built before documentation in the usual build folder
29+
sys.path.insert(0, os.path.abspath('../build/lib/python'))
30+
2531
import nmodl # isort:skip
2632

2733
# Run doxygen

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def build_extension(self, ext):
100100
build_args += ["--", "/m"]
101101
else:
102102
cmake_args += ["-DCMAKE_BUILD_TYPE=" + cfg]
103-
build_args += ["--", "-j{}".format(max(1, os.cpu_count() - 1))]
103+
build_args += ["--", "-j{}".format(max(1, os.cpu_count() - 3))]
104104

105105
env = os.environ.copy()
106106
env["CXXFLAGS"] = '{} -DVERSION_INFO=\\"{}\\"'.format(
@@ -147,7 +147,7 @@ def run(self):
147147
)
148148

149149

150-
install_requirements = ["jinja2>=2.9", "PyYAML>=3.13", "sympy>=1.3"]
150+
install_requirements = ["jinja2>=2.9.3", "PyYAML>=3.13", "sympy>=1.3"]
151151

152152
setup(
153153
name="NMODL",
@@ -167,7 +167,7 @@ def run(self):
167167
buildhtml=get_sphinx_command,
168168
),
169169
zip_safe=False,
170-
setup_requires=["nbsphinx>=0.3.2", "m2r", "sphinx-rtd-theme", "sphinx>=2.0"]
170+
setup_requires=["nbsphinx>=0.3.2", "m2r", "sphinx-rtd-theme", "sphinx>=2.0", "sphinx<3.0"]
171171
+ install_requirements,
172172
install_requires=install_requirements,
173173
tests_require=["pytest>=3.7.2"],

src/codegen/codegen_c_visitor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ class CodegenCVisitor: public visitor::AstVisitor {
17851785
* Find unique variable name defined in nmodl::utils::SingletonRandomString by the
17861786
* nmodl::visitor::SympySolverVisitor
17871787
* @param original_name Original name of variable to change
1788-
* @return std::string Unique name produced as <original_name>_<random_string>
1788+
* @return std::string Unique name produced as "original_string"_"random_string"
17891789
*/
17901790
std::string find_var_unique_name(const std::string& original_name);
17911791

src/language/templates/ast/ast.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ struct Ast: public std::enable_shared_from_this<Ast> {
333333
* returning a raw pointer may create less problems that the
334334
* shared_from_this from the parent.
335335
*
336-
* \ref Check Ast::parent for more information
336+
* Check \ref Ast::parent for more information
337337
*/
338338
virtual Ast* get_parent() const;
339339

@@ -345,7 +345,7 @@ struct Ast: public std::enable_shared_from_this<Ast> {
345345
* we set children parents directly in the parent constructor using
346346
* set_parent_in_children()
347347
*
348-
* \ref Check Ast::parent for more information
348+
* Check \ref Ast::parent for more information
349349
*/
350350
virtual void set_parent(Ast* p);
351351
};

src/language/templates/visitors/checkparent_visitor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* \brief Auto generated visitors
1818
*
1919
* \file
20-
* \brief \copybrief nmodl::visitor::CheckParentVisitor
20+
* \brief \copybrief nmodl::visitor::test::CheckParentVisitor
2121
*/
2222

2323
#include "visitors/ast_visitor.hpp"

src/visitors/sympy_solver_visitor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ std::string SympySolverVisitor::suffix_random_string(const std::string& original
159159
auto singleton_random_string_class = nmodl::utils::SingletonRandomString<4>::instance();
160160
// Check if there is a variable defined in the mod file as original_string and if yes
161161
// try to use a different string for the matrices created by sympy in the form
162-
// <original_string>_<random_string>
162+
// "original_string"_"random_string"
163163
while (vars.find(new_string) != vars.end()) {
164164
random_string = singleton_random_string_class->reset_random_string(original_string);
165165
new_string = original_string;

src/visitors/sympy_solver_visitor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class SympySolverVisitor: public AstVisitor {
109109
const std::string& original_string,
110110
const std::string& substitution_string) const;
111111

112-
/// Return a std::string in the form <original_string>_<random_string>, where
112+
/// Return a std::string in the form "original_string"_"random_string", where
113113
/// random_string is a string defined in the nmodl::utils::SingletonRandomString
114114
/// for the original_string
115115
std::string suffix_random_string(const std::string& original_string) const;

0 commit comments

Comments
 (0)