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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up nitclk docs #1043

Merged
merged 132 commits into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
08fc91a
Add initial metadata
texasaggie97-zz Aug 29, 2019
9d53c62
Create nitclk.mak
texasaggie97-zz Aug 29, 2019
39c2ed7
Remove numpy restriction
texasaggie97-zz Aug 29, 2019
571206f
Upgrade pip
texasaggie97-zz Aug 29, 2019
b7732eb
Remove specific version of flake8
texasaggie97-zz Aug 29, 2019
41cf6ca
Add basepython section
texasaggie97-zz Aug 29, 2019
e074561
Try using pypy3.5
texasaggie97-zz Aug 29, 2019
defd961
Go back to pypy3 and remove basepython block
texasaggie97-zz Aug 29, 2019
ae86324
Don't need to run build_test for all builds - only 3.6
texasaggie97-zz Aug 29, 2019
5a97c42
Remove warning from coverage
texasaggie97-zz Aug 30, 2019
ef21c76
Undo previous change
texasaggie97-zz Aug 30, 2019
143e08f
Try disabling faulthandler
texasaggie97-zz Aug 30, 2019
3673d09
Remove --no-faulthandler
texasaggie97-zz Aug 30, 2019
f1ae55d
pypy needs an older version of pytest
texasaggie97-zz Aug 30, 2019
a4a28fa
Use platform_python_implementation since implementation_name is not d…
texasaggie97-zz Aug 30, 2019
1251734
Try to get back to the initial coverage
texasaggie97-zz Aug 30, 2019
b3005f0
Do the same thing for build_test
texasaggie97-zz Aug 30, 2019
b6b5a30
Remove redundant pip
texasaggie97-zz Aug 30, 2019
d8f4566
Merge branch 'clean_tox' into add_tclk/metadata
texasaggie97-zz Aug 30, 2019
5e4c3da
Merge branch 'add_tclk/metadata' into add_tclk/simple_codegen
texasaggie97-zz Aug 30, 2019
8fd761d
Add codecov file to try to control limits for passing
texasaggie97-zz Sep 3, 2019
8052328
Merge branch 'clean_tox' into build/codecov
texasaggie97-zz Sep 3, 2019
d7f5f9c
Merge branch 'build/codecov' into add_tclk/metadata
texasaggie97-zz Sep 3, 2019
09cac06
Merge branch 'add_tclk/metadata' into add_tclk/simple_codegen
texasaggie97-zz Sep 3, 2019
d84d22f
Enable nitclk build
texasaggie97-zz Sep 3, 2019
b135799
There are some files we will need to skip for now
texasaggie97-zz Sep 3, 2019
b1f3290
Add generated nitclk files
texasaggie97-zz Sep 3, 2019
c31a6b4
Update generated files
texasaggie97-zz Sep 3, 2019
7baef6a
Can't skip README.rst
texasaggie97-zz Sep 3, 2019
f05da64
Update templates
texasaggie97-zz Sep 3, 2019
31d1509
Add new cases for buffers with a converter
texasaggie97-zz Sep 3, 2019
95c96da
Need to handle ' []' to normalize everything
texasaggie97-zz Sep 3, 2019
0ac90fa
Get the session handle name from config instead of hardcoding 'vi'
texasaggie97-zz Sep 3, 2019
7ab3975
Temp commit
texasaggie97-zz Sep 3, 2019
76c608e
Fix syntax error
texasaggie97-zz Sep 4, 2019
0d71be0
Test new cases
texasaggie97-zz Sep 4, 2019
cabe80f
Merge branch 'master' into add_tclk/simple_codegen
texasaggie97-zz Sep 4, 2019
c6e0a7c
Force change
texasaggie97-zz Sep 4, 2019
a40e9c5
Update generated files
texasaggie97-zz Sep 4, 2019
3afc75e
Merge branch 'master' into add_tclk/simple_codegen
texasaggie97-zz Sep 4, 2019
f8eda3f
Update generated files
texasaggie97-zz Sep 4, 2019
af28fc7
Merge branch 'add_tclk/simple_codegen' into add_tclk/codegen_changes
texasaggie97-zz Sep 4, 2019
22890c1
Add different target for pr (project) and commit (patch)
texasaggie97-zz Sep 4, 2019
ea12f9b
threshold should be number
texasaggie97-zz Sep 4, 2019
b040199
Renumber scaler cases to be in order used in the code
texasaggie97-zz Sep 4, 2019
37b11e0
Update generated files
texasaggie97-zz Sep 4, 2019
4b1082b
Renumber buffer cases to match order used in code
texasaggie97-zz Sep 4, 2019
30bc0ce
Move and rename test to match case (C020)
texasaggie97-zz Sep 4, 2019
4d3ae50
Merge branch 'master' into add_tclk/fix_case_sequence
texasaggie97-zz Sep 4, 2019
5534ccf
Merge branch 'master' into add_tclk/nitclk_template_changes
texasaggie97-zz Sep 4, 2019
7b37c71
Merge branch 'add_tclk/fix_case_sequence' into add_tclk/nitclk_templa…
texasaggie97-zz Sep 4, 2019
24bd847
Update generated files
texasaggie97-zz Sep 4, 2019
5650e56
Merge branch 'master' into add_tclk/nitclk_template_changes
texasaggie97-zz Sep 4, 2019
a65cc12
Add nitclk specific session template
texasaggie97-zz Sep 5, 2019
70f9dbb
No longer need to skip generating session.py
texasaggie97-zz Sep 5, 2019
aea6f50
Add new session.py
texasaggie97-zz Sep 5, 2019
cfe8ab3
Add placeholder nitclk example
texasaggie97-zz Sep 5, 2019
5a0be07
Enable example documentation build
texasaggie97-zz Sep 5, 2019
8e55771
Add generated examples.rst
texasaggie97-zz Sep 5, 2019
31f64c5
Merge branch 'add_tclk/add_example' into add_tclk/enable_documentation
texasaggie97-zz Sep 5, 2019
4b8e30d
Add TClk to static files
texasaggie97-zz Sep 5, 2019
3ce9738
Add tclk to index
texasaggie97-zz Sep 5, 2019
cde1321
Add tclk top level file
texasaggie97-zz Sep 5, 2019
62bdd35
Update generated files
texasaggie97-zz Sep 5, 2019
9bf949f
Merge branch 'add_tclk/add_example' into add_tclk/enable_unit_tests
texasaggie97-zz Sep 5, 2019
7f5cc84
Add VIUInt32 matcher
texasaggie97-zz Sep 6, 2019
2d5fcd7
Add ViSession buffer matcher
texasaggie97-zz Sep 6, 2019
82d38b1
We want to look at all of nitclk since there are differences in some …
texasaggie97-zz Sep 6, 2019
16930df
Run unit tests on nitclk
texasaggie97-zz Sep 6, 2019
d3a55f1
Add initial test and setup
texasaggie97-zz Sep 6, 2019
d46ca98
Update generated files
texasaggie97-zz Sep 6, 2019
c70a6ef
Correct wrong exception
texasaggie97-zz Sep 6, 2019
48ff943
Rename test
texasaggie97-zz Sep 6, 2019
0ca1883
Add return (helps editor auto formatting)
texasaggie97-zz Sep 6, 2019
115def3
Update generated files
texasaggie97-zz Sep 6, 2019
d17e564
Merge branch 'master' into add_tclk/enable_unit_tests
texasaggie97-zz Sep 6, 2019
ca2945a
Few more tests
texasaggie97-zz Sep 6, 2019
2efed70
Merge branch 'master' into add_tclk/more_unit_tests
texasaggie97-zz Sep 9, 2019
af60acd
Add new filter type
texasaggie97-zz Sep 9, 2019
ad87c3f
Don't try to use a singleton any more - didn't work
texasaggie97-zz Sep 9, 2019
bad37ba
Use new filter type
texasaggie97-zz Sep 9, 2019
0f984d6
All API functions tested
texasaggie97-zz Sep 9, 2019
963cce3
Update generated files
texasaggie97-zz Sep 9, 2019
f3ea8a1
Fix metadata for GetAttributeViString
texasaggie97-zz Sep 9, 2019
eb7bacd
More tests!
texasaggie97-zz Sep 9, 2019
f9192aa
Correct type is ViSession
texasaggie97-zz Sep 17, 2019
7fd2646
Need to say it isn't the session handle
texasaggie97-zz Sep 17, 2019
dd909cd
Test class for testing session number converter
texasaggie97-zz Sep 17, 2019
66eb066
Additional tests
texasaggie97-zz Sep 17, 2019
e3232a4
Update generated files
texasaggie97-zz Sep 17, 2019
2791d07
Merge branch 'master' into add_tclk/more_unit_tests
texasaggie97-zz Sep 17, 2019
2ddaeee
We don't need to measure anything from nitclk or nimodinst other than…
texasaggie97-zz Sep 18, 2019
a7c43e0
Fix class names to work with pytest
texasaggie97-zz Sep 18, 2019
4f89b1f
Use correct name
texasaggie97-zz Sep 18, 2019
3b0a016
Don't codegen ViBoolean functions since they aren't actually used
texasaggie97-zz Sep 18, 2019
667dad8
Update generated files
texasaggie97-zz Sep 18, 2019
f17b516
Handle not having an 'init_function' in config
texasaggie97-zz Sep 18, 2019
b79407c
Remove InitForDocumentation
texasaggie97-zz Sep 18, 2019
7ae9806
Add tclk specific class.rst template
texasaggie97-zz Sep 18, 2019
83dfb8d
Updates
texasaggie97-zz Sep 18, 2019
167507e
Build using nitclk specific class.rst template
texasaggie97-zz Sep 18, 2019
e887d1f
Add type in documentation
texasaggie97-zz Sep 18, 2019
5ddf7d8
Fix output path
texasaggie97-zz Sep 18, 2019
b4325f7
Documentation updates
texasaggie97-zz Sep 19, 2019
366d3f2
Merge branch 'add_tclk/enable_documentation' into add_tclk/update_docs
texasaggie97-zz Sep 19, 2019
3d8cbf1
We need to be able to use method or function, default is method
texasaggie97-zz Sep 19, 2019
11ca67b
Links need to be different for nitclk
texasaggie97-zz Sep 19, 2019
a713587
Clean up nitclk class documentation
texasaggie97-zz Sep 19, 2019
c6392f9
Update generated files
texasaggie97-zz Sep 19, 2019
3df99d6
Merge branch 'master' into add_tclk/update_docs
texasaggie97-zz Sep 19, 2019
88013cf
Update generated files
texasaggie97-zz Sep 19, 2019
04eb58b
Merge branch 'master' into add_tclk/more_unit_tests
texasaggie97-zz Sep 19, 2019
c8fbbdc
Use the session name from config - doesn't always match the parameter…
texasaggie97-zz Sep 19, 2019
5feb02e
Update converter name
texasaggie97-zz Sep 19, 2019
4374630
Need a reperated capabilities for get/set attribute
texasaggie97-zz Sep 19, 2019
cf16bf2
Function is now private
texasaggie97-zz Sep 19, 2019
8e500bc
Update generated files
texasaggie97-zz Sep 19, 2019
7bb51fd
Merge branch 'add_tclk/more_unit_tests' into add_tclk/update_docs
texasaggie97-zz Sep 19, 2019
912c370
Update
texasaggie97-zz Sep 19, 2019
3947ebe
Remove extraneous comment
texasaggie97-zz Sep 19, 2019
0d6a364
Only add properties section if there are actually properties
texasaggie97-zz Sep 19, 2019
5eb21b3
Update to match latest format in master
texasaggie97-zz Sep 19, 2019
be1e02a
Update generated files
texasaggie97-zz Sep 19, 2019
ca4be07
Use the entire navigation depth
texasaggie97-zz Sep 19, 2019
08ce4c5
Merge branch 'master' into add_tclk/update_docs
texasaggie97-zz Sep 24, 2019
21a7745
Remove unused parameter
texasaggie97-zz Sep 24, 2019
219c8c5
Clarify docstring
texasaggie97-zz Sep 24, 2019
7a96828
Fix example code to actually work
texasaggie97-zz Sep 24, 2019
04e3984
Update NI-TClk description
texasaggie97-zz Sep 24, 2019
a8243bf
Update generated files
texasaggie97-zz Sep 24, 2019
fa53c27
Lower target for patch
texasaggie97-zz Sep 25, 2019
78308ce
Merge branch 'master' into add_tclk/update_docs
texasaggie97-zz Sep 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ coverage:
threshhold: 5
patch:
default:
target: 85%
target: 70%
threshhold: 5


16 changes: 11 additions & 5 deletions build/helper/documentation_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,10 @@ def _replace_attribute_python_name(a_match):
aname = attr['name'].lower()

if config['make_link']:
return ':py:data:`{0}.Session.{1}`'.format(config['module_name'], aname)
if config['module_name'] == 'nitclk':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty uncomfortable adding conditional logic based on specific module names to the code-generator logic.
We should really try to keep this generic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How? What can we key on instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If driver config had:

  • Name of the main class
  • Add properties to main class
  • Add functions as methods to main class

Could we then make better reuse of the templates and get rid of this conditional logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but to quote a top notch engineer from a different review "The medicine is worse than the disease".

It would remove using 'nitclk' in the conditionals here (but not remove them), and session.py.mako would become much more complicated and less easy to follow with the conditionals there surrounding large blocks of code.

And I don't think it would be enough to combine the nitclk session.py.mako with the generic one. Or if it is, it would become even more complicated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels very wrong and hacky, but I can see it being the pragmatic solution. At least we tried.

return ':py:attr:`{0}.SessionReference.{1}`'.format(config['module_name'], aname)
else:
return ':py:data:`{0}.Session.{1}`'.format(config['module_name'], aname)
else:
return '{0}'.format(aname)

Expand Down Expand Up @@ -381,7 +384,10 @@ def _replace_func_python_name(f_match):
print(config['functions'])

if config['make_link']:
return ':py:meth:`{0}.Session.{1}`'.format(config['module_name'], fname)
if config['module_name'] == 'nitclk':
return ':py:func:`{0}.{1}`'.format(config['module_name'], fname)
else:
return ':py:meth:`{0}.Session.{1}`'.format(config['module_name'], fname)
else:
return '{0}'.format(fname)

Expand Down Expand Up @@ -491,8 +497,8 @@ def format_type_for_rst_documentation(param, numpy, config):
return p_type


def get_function_rst(function, method_template, numpy, config, indent=0):
'''Gets formatted documentation for given function that can be used in rst documentation
def get_function_rst(function, method_template, numpy, config, indent=0, method_or_function='method'):
'''Gets formatted documentation for given function or method that can be used in rst documentation

Args:
function (dict): function dictionary
Expand All @@ -515,7 +521,7 @@ def get_function_rst(function, method_template, numpy, config, indent=0):
if function['has_repeated_capability'] is True:
function['documentation']['tip'] = rep_cap_method_desc_rst.format(config['module_name'], function['repeated_capability_type'], function['python_name'], get_params_snippet(function, session_method))

rst = '.. py:method:: ' + function['python_name'] + suffix + '('
rst = '.. py:{0}:: {1}{2}('.format(method_or_function, function['python_name'], suffix)
rst += get_params_snippet(function, session_method) + ')'
indent += 4
rst += get_documentation_for_node_rst(function, config, indent)
Expand Down
8 changes: 6 additions & 2 deletions build/helper/metadata_add_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,12 @@ def _setup_init_function(functions, config):

functions['_init_function'] = init_function
except KeyError:
print("Couldn't find {} init function".format(config['init_function']))
pass
if 'init_function' not in config or config['init_function'] is None:
# We don't have an init function or it is set to None (same thing) so we can't
# do anything here
pass
else:
print("Couldn't find {} init function".format(config['init_function']))


def add_all_function_metadata(functions, config):
Expand Down
4 changes: 2 additions & 2 deletions build/templates/class.rst.mako
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ ${helper.get_rst_header_snippet(item, '-')}

% endfor

% if len(attributes) > 0:
${helper.get_rst_header_snippet('Properties', '=')}

% for attr in helper.sorted_attrs(attributes):
<% # ${helper.get_rst_header_snippet(attributes[attr]["python_name"], '~')}
%>\
${helper.get_rst_header_snippet(attributes[attr]['python_name'], '-')}

.. py:attribute:: ${attributes[attr]["python_name"]}
Expand Down Expand Up @@ -101,6 +100,7 @@ desc = helper.get_documentation_for_node_rst(a, config, indent=0)
- C Attribute: **${c_function_prefix.upper()}ATTR_${attributes[attr]["name"].upper()}**

% endfor
% endif

.. contents:: Session

Expand Down
7 changes: 3 additions & 4 deletions build/templates/conf.py.mako
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ html_theme = 'sphinx_rtd_theme'
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
html_theme_options = {
'navigation_depth': -1,
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down Expand Up @@ -186,9 +188,6 @@ texinfo_documents = [
'Miscellaneous'),
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}

3 changes: 0 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ def setup(app):
'Miscellaneous'),
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}

3 changes: 0 additions & 3 deletions docs/nise/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,6 @@ wait_for_debounce
:type maximum_time_ms: float in seconds or datetime.timedelta


Properties
==========


.. contents:: Session

Expand Down
Loading