-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add initial metadata * Create nitclk.mak * Remove numpy restriction Bug fixed * Upgrade pip * Remove specific version of flake8 '\' in comments now need to be escaped * Add basepython section * Try using pypy3.5 * Go back to pypy3 and remove basepython block * Don't need to run build_test for all builds - only 3.6 * Remove warning from coverage * Undo previous change * Try disabling faulthandler * Remove --no-faulthandler * pypy needs an older version of pytest See pytest-dev/pytest#5807 * Use platform_python_implementation since implementation_name is not defined on Python2 * Try to get back to the initial coverage * Do the same thing for build_test * Remove redundant pip * Add codecov file to try to control limits for passing * Enable nitclk build * There are some files we will need to skip for now * Add generated nitclk files * Update generated files * Can't skip README.rst * Force change * Update generated files * Update generated files
- Loading branch information
1 parent
55e9e97
commit 5de4716
Showing
19 changed files
with
2,819 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Usage | ||
------ | ||
|
||
The following is a basic example of using the **nitclk** module | ||
|
||
.. code-block:: python | ||
|
||
import nitclk | ||
|
||
Additional examples for NI-TClk are located in src/nitclk/examples/ directory. | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
Exceptions and Warnings | ||
======================= | ||
|
||
DriverError | ||
----------- | ||
|
||
.. py:currentmodule:: nitclk | ||
.. exception:: DriverError | ||
|
||
An error originating from the NI-TClk driver | ||
|
||
|
||
UnsupportedConfigurationError | ||
----------------------------- | ||
|
||
.. py:currentmodule:: nitclk | ||
.. exception:: UnsupportedConfigurationError | ||
|
||
An error due to using this module in an usupported platform. | ||
|
||
DriverNotInstalledError | ||
----------------------- | ||
|
||
.. py:currentmodule:: nitclk | ||
.. exception:: DriverNotInstalledError | ||
|
||
An error due to using this module without the driver runtime installed. | ||
|
||
InvalidRepeatedCapabilityError | ||
------------------------------ | ||
|
||
.. py:currentmodule:: nitclk | ||
.. exception:: InvalidRepeatedCapabilityError | ||
|
||
An error due to an invalid character in a repeated capability | ||
|
||
|
||
SelfTestError | ||
------------- | ||
|
||
.. py:currentmodule:: nitclk | ||
.. exception:: SelfTestError | ||
|
||
An error due to a failed self-test | ||
|
||
|
||
DriverWarning | ||
------------- | ||
|
||
.. py:currentmodule:: nitclk | ||
.. exception:: DriverWarning | ||
|
||
A warning originating from the NI-TClk driver | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
.. _nitclk_installation-section: | ||
|
||
Installation | ||
------------ | ||
|
||
As a prerequisite to using the nitclk module, you must install the NI-TClk runtime on your system. Visit `ni.com/downloads <http://www.ni.com/downloads/>`_ to download the driver runtime for your devices. | ||
|
||
The nimi-python modules (i.e. for **NI-TClk**) can be installed with `pip <http://pypi.python.org/pypi/pip>`_:: | ||
|
||
$ python -m pip install nitclk~=0.1.0.dev0 | ||
|
||
Or **easy_install** from | ||
`setuptools <http://pypi.python.org/pypi/setuptools>`_:: | ||
|
||
$ python -m easy_install nitclk | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
NI-TClk Python API Status | ||
------------------------- | ||
|
||
+-------------------------------+-----------------------+ | ||
| NI-TClk (nitclk) | | | ||
+===============================+=======================+ | ||
| Driver Version Tested Against | 18.0.0 | | ||
+-------------------------------+-----------------------+ | ||
| Driver API Version | 255.0.0d0 | | ||
+-------------------------------+-----------------------+ | ||
| PyPI Version | |nitclkLatestVersion| | | ||
+-------------------------------+-----------------------+ | ||
| Supported Python Version | |nitclkPythonVersion| | | ||
+-------------------------------+-----------------------+ | ||
| Open Issues | |nitclkOpenIssues| | | ||
+-------------------------------+-----------------------+ | ||
| Open Pull Requests | |nitclkOpenPRs| | | ||
+-------------------------------+-----------------------+ | ||
|
||
|
||
.. |nitclkLatestVersion| image:: http://img.shields.io/pypi/v/nitclk.svg | ||
:alt: Latest NI-TClk Version | ||
:target: http://pypi.python.org/pypi/nitclk | ||
|
||
|
||
.. |nitclkPythonVersion| image:: http://img.shields.io/pypi/pyversions/nitclk.svg | ||
:alt: NI-TClk supported Python versions | ||
:target: http://pypi.python.org/pypi/nitclk | ||
|
||
|
||
.. |nitclkOpenIssues| image:: https://img.shields.io/github/issues/ni/nimi-python/nitclk.svg | ||
:alt: Open Issues + Pull Requests for NI-TClk | ||
:target: https://github.com/ni/nimi-python/issues?q=is%3Aopen+is%3Aissue+label%3Anitclk | ||
|
||
|
||
.. |nitclkOpenPRs| image:: https://img.shields.io/github/issues-pr/ni/nimi-python/nitclk.svg | ||
:alt: Pull Requests for NI-TClk | ||
:target: https://github.com/ni/nimi-python/pulls?q=is%3Aopen+is%3Aissue+label%3Anitclk | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
API Reference | ||
-------------- | ||
|
||
.. toctree:: | ||
:maxdepth: 6 | ||
|
||
nitclk/class | ||
nitclk/errors | ||
nitclk/examples | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# -*- coding: utf-8 -*- | ||
# This file was generated | ||
|
||
|
||
__version__ = '0.1.0.dev0' | ||
|
||
from nitclk.errors import DriverWarning # noqa: F401 | ||
from nitclk.errors import Error # noqa: F401 | ||
from nitclk.session import Session # noqa: F401 | ||
|
||
|
||
def get_diagnostic_information(): | ||
'''Get diagnostic information about the system state that is suitable for printing or logging | ||
returns: dict | ||
note: Python bitness may be incorrect when running in a virtual environment | ||
''' | ||
import os | ||
import pkg_resources | ||
import platform | ||
import struct | ||
import sys | ||
|
||
def is_python_64bit(): | ||
return (struct.calcsize("P") == 8) | ||
|
||
def is_os_64bit(): | ||
return platform.machine().endswith('64') | ||
|
||
def is_venv(): | ||
return 'VIRTUAL_ENV' in os.environ | ||
|
||
info = {} | ||
info['os'] = {} | ||
info['python'] = {} | ||
info['driver'] = {} | ||
info['module'] = {} | ||
if platform.system() == 'Windows': | ||
try: | ||
import winreg as winreg | ||
except ImportError: | ||
import _winreg as winreg | ||
|
||
os_name = 'Windows' | ||
try: | ||
driver_version_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\National Instruments\NI-TClk\CurrentVersion") | ||
driver_version = winreg.QueryValueEx(driver_version_key, "Version")[0] | ||
except WindowsError: | ||
driver_version = 'Unknown' | ||
elif platform.system() == 'Linux': | ||
os_name = 'Linux' | ||
driver_version = 'Unknown' | ||
else: | ||
raise SystemError('Unsupported platform: {}'.format(platform.system())) | ||
|
||
installed_packages = pkg_resources.working_set | ||
installed_packages_list = [{'name': i.key, 'version': i.version, } for i in installed_packages] | ||
|
||
info['os']['name'] = os_name | ||
info['os']['version'] = platform.version() | ||
info['os']['bits'] = '64' if is_os_64bit() else '32' | ||
info['driver']['name'] = "NI-TClk" | ||
info['driver']['version'] = driver_version | ||
info['module']['name'] = 'nitclk' | ||
info['module']['version'] = "0.1.0.dev0" | ||
info['python']['version'] = sys.version | ||
info['python']['bits'] = '64' if is_python_64bit() else '32' | ||
info['python']['is_venv'] = is_venv() | ||
info['python']['packages'] = installed_packages_list | ||
|
||
return info | ||
|
||
|
||
def print_diagnostic_information(): | ||
'''Print diagnostic information in a format suitable for issue report | ||
note: Python bitness may be incorrect when running in a virtual environment | ||
''' | ||
info = get_diagnostic_information() | ||
|
||
row_format = ' {:<10} {}' | ||
for type in ['OS', 'Driver', 'Module', 'Python']: | ||
typename = type.lower() | ||
print(type + ':') | ||
for item in info[typename]: | ||
if item != 'packages': | ||
print(row_format.format(item.title() + ':', info[typename][item])) | ||
print(' Installed Packages:') | ||
for p in info['python']['packages']: | ||
print((' ' * 8) + p['name'] + '==' + p['version']) | ||
|
||
return info | ||
|
||
|
Oops, something went wrong.