-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathContributing.html
More file actions
157 lines (142 loc) · 9.25 KB
/
Copy pathContributing.html
File metadata and controls
157 lines (142 loc) · 9.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>1. Contributing — FitSNAP documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="2. Executable" href="Executable.html" />
<link rel="prev" title="5. PyTorch Models" href="Pytorch.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html">
<img src="_static/FitSNAP.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">User Guide</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="Introduction.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Installation.html">2. Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="Run/index.html">3. Run FitSNAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="Linear.html">4. Linear Models</a></li>
<li class="toctree-l1"><a class="reference internal" href="Pytorch.html">5. PyTorch Models</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Programmer Guide</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">1. Contributing</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#style-guide">1.1. Style Guide</a></li>
<li class="toctree-l2"><a class="reference internal" href="#documenting">1.2. Documenting</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Executable.html">2. Executable</a></li>
<li class="toctree-l1"><a class="reference internal" href="Lib/index.html">3. Library</a></li>
<li class="toctree-l1"><a class="reference internal" href="Tests.html">4. Tests</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">FitSNAP</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> »</li>
<li><span class="section-number">1. </span>Contributing</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/Contributing.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="contributing">
<h1><span class="section-number">1. </span>Contributing<a class="headerlink" href="#contributing" title="Permalink to this heading"></a></h1>
<p>Important points to follow are explained below.</p>
<section id="style-guide">
<h2><span class="section-number">1.1. </span>Style Guide<a class="headerlink" href="#style-guide" title="Permalink to this heading"></a></h2>
<p>Please follow the current style conventions in main FitSNAP files such as <code class="code docutils literal notranslate"><span class="pre">fitsnap3lib/fitsnap.py</span></code>.</p>
<ul class="simple">
<li><p>Indent size is 4 spaces, and use actual spaces (not tabs); set your tab key to equal 4 spaces.</p></li>
<li><p>Maximum line length is 100 characters. Set a vertical ruler in your editor and try to terminate
lines once they reach 100 characters. This makes code easier to read without horiztonal scrolling.</p></li>
<li><p>Naming styles: <code class="code docutils literal notranslate"><span class="pre">module_name</span></code>, <code class="code docutils literal notranslate"><span class="pre">package_name</span></code>, <code class="code docutils literal notranslate"><span class="pre">ClassName</span></code>, <code class="code docutils literal notranslate"><span class="pre">method_name</span></code>,
<code class="code docutils literal notranslate"><span class="pre">ExceptionName</span></code>, <code class="code docutils literal notranslate"><span class="pre">function_name</span></code>, <code class="code docutils literal notranslate"><span class="pre">GLOBAL_CONSTANT_NAME</span></code>, <code class="code docutils literal notranslate"><span class="pre">global_var_name</span></code>,
<code class="code docutils literal notranslate"><span class="pre">instance_var_name</span></code>, <code class="code docutils literal notranslate"><span class="pre">function_parameter_name</span></code>, <code class="code docutils literal notranslate"><span class="pre">local_var_name</span></code></p></li>
<li><p>Avoid global variables that are declared outside class methods or attributes, except in necessary
circumstances; sometimes it’s useful, but you need to make sure that it doesn’t affect unrelated
FitSNAP uses.</p></li>
<li><p>Prefer imported functions to new classes with state dependence.</p></li>
</ul>
<p>For other style advice, consult Google’s Python style guide when in doubt:
<a class="reference external" href="https://google.github.io/styleguide/pyguide.html">https://google.github.io/styleguide/pyguide.html</a></p>
</section>
<section id="documenting">
<h2><span class="section-number">1.2. </span>Documenting<a class="headerlink" href="#documenting" title="Permalink to this heading"></a></h2>
<p>All new features and examples must be documented. If adding a new feature, it should be explain in
the appropriate section of our docs. For example if adding a new scraper capability, elaborate in
<a class="reference external" href="Run.html#scraper">Scraper</a>. This is done by editing the RST files <code class="code docutils literal notranslate"><span class="pre">docs/source</span></code> and
building with Sphinx; see more info in the README in the <code class="code docutils literal notranslate"><span class="pre">docs</span></code> directory.</p>
<p>Classes and functions should contain docstrings. We use Google style docstrings, see
<code class="code docutils literal notranslate"><span class="pre">fitsnap3lib/fitsnap.py</span></code> for examples.</p>
<p>New examples must be documented in a README in their appropriate directory. Be specific on how to
run the example.</p>
<p>More information on Google’s style guide for docs:</p>
<p><a class="reference external" href="https://gist.github.com/redlotus/3bc387c2591e3e908c9b63b97b11d24e">https://gist.github.com/redlotus/3bc387c2591e3e908c9b63b97b11d24e</a></p>
<p><a class="reference external" href="https://www.sphinx-doc.org/en/master/usage/extensions/example_google.html">https://www.sphinx-doc.org/en/master/usage/extensions/example_google.html</a></p>
<p>Please reach out or raise an issue on GitHub if you want more info about adding
a new feature.</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="Pytorch.html" class="btn btn-neutral float-left" title="5. PyTorch Models" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="Executable.html" class="btn btn-neutral float-right" title="2. Executable" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2022, Sandia Corporation.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>