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

Ran pre-commit, added licenses #16

Merged
merged 1 commit into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense

*.mpy
.idea
__pycache__
Expand Down
4 changes: 4 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense

[MASTER]

# A comma-separated list of package or module names from where C extensions may
Expand Down
4 changes: 4 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense

python:
version: 3
requirements_file: requirements.txt
14 changes: 10 additions & 4 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
SPDX-License-Identifier: CC-BY-4.0
-->

# Adafruit Community Code of Conduct

## Our Pledge
Expand Down Expand Up @@ -43,7 +49,7 @@ Examples of unacceptable behavior by participants include:

The goal of the standards and moderation guidelines outlined here is to build
and maintain a respectful community. We ask that you don’t just aim to be
"technically unimpeachable", but rather try to be your best self.
"technically unimpeachable", but rather try to be your best self.

We value many things beyond technical expertise, including collaboration and
supporting others within our community. Providing a positive experience for
Expand Down Expand Up @@ -74,9 +80,9 @@ You may report in the following ways:
In any situation, you may send an email to <[email protected]>.

On the Adafruit Discord, you may send an open message from any channel
to all Community Moderators by tagging @community moderators. You may
also send an open message from any channel, or a direct message to
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
to all Community Moderators by tagging @community moderators. You may
also send an open message from any channel, or a direct message to
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.

Email and direct message reports will be kept confidential.
Expand Down
324 changes: 324 additions & 0 deletions LICENSES/CC-BY-4.0.txt

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions LICENSES/MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
MIT License Copyright (c) <year> <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 changes: 20 additions & 0 deletions LICENSES/Unlicense.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute
this software, either in source code form or as a compiled binary, for any
purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this
software dedicate any and all copyright interest in the software to the public
domain. We make this dedication for the benefit of the public at large and
to the detriment of our heirs and successors. We intend this dedication to
be an overt act of relinquishment in perpetuity of all present and future
rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information,
please refer to <https://unlicense.org/>
3 changes: 3 additions & 0 deletions README.rst.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries

SPDX-License-Identifier: MIT
131 changes: 57 additions & 74 deletions adafruit_ina260.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
# The MIT License (MIT)
# SPDX-FileCopyrightText: Bryan Siepert 2019 for Adafruit Industries
#
# Copyright (c) 2019 Bryan Siepert for Adafruit Industries
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# SPDX-License-Identifier: MIT

"""
`adafruit_ina260`
================================================================================
Expand Down Expand Up @@ -69,20 +52,20 @@
class Mode:
"""Modes avaible to be set

+--------------------+---------------------------------------------------------------------+
| Mode | Description |
+====================+=====================================================================+
| ``Mode.CONTINUOUS``| Default: The sensor will continuously measure the bus voltage and |
| | shunt voltage across the shunt resistor to calculate ``power`` and |
| | ``current`` |
+--------------------+---------------------------------------------------------------------+
| ``Mode.TRIGGERED`` | The sensor will immediately begin measuring and calculating current,|
| | bus voltage, and power. Re-set this mode to initiate another |
| | measurement |
+--------------------+---------------------------------------------------------------------+
| ``Mode.SHUTDOWN`` | Shutdown the sensor, reducing the quiescent current and turning off|
| | current into the device inputs. Set another mode to re-enable |
+--------------------+---------------------------------------------------------------------+
+--------------------+---------------------------------------------------------------------+
| Mode | Description |
+====================+=====================================================================+
| ``Mode.CONTINUOUS``| Default: The sensor will continuously measure the bus voltage and |
| | shunt voltage across the shunt resistor to calculate ``power`` and |
| | ``current`` |
+--------------------+---------------------------------------------------------------------+
| ``Mode.TRIGGERED`` | The sensor will immediately begin measuring and calculating current,|
| | bus voltage, and power. Re-set this mode to initiate another |
| | measurement |
+--------------------+---------------------------------------------------------------------+
| ``Mode.SHUTDOWN`` | Shutdown the sensor, reducing the quiescent current and turning off|
| | current into the device inputs. Set another mode to re-enable |
+--------------------+---------------------------------------------------------------------+

"""

Expand All @@ -94,25 +77,25 @@ class Mode:
class ConversionTime:
"""Options for ``current_conversion_time`` or ``voltage_conversion_time``

+----------------------------------+------------------+
| ``ConversionTime`` | Time |
+==================================+==================+
| ``ConversionTime.TIME_140_us`` | 140 us |
+----------------------------------+------------------+
| ``ConversionTime.TIME_204_us`` | 204 us |
+----------------------------------+------------------+
| ``ConversionTime.TIME_332_us`` | 332 us |
+----------------------------------+------------------+
| ``ConversionTime.TIME_558_us`` | 588 us |
+----------------------------------+------------------+
| ``ConversionTime.TIME_1_1_ms`` | 1.1 ms (Default) |
+----------------------------------+------------------+
| ``ConversionTime.TIME_2_116_ms`` | 2.116 ms |
+----------------------------------+------------------+
| ``ConversionTime.TIME_4_156_ms`` | 4.156 ms |
+----------------------------------+------------------+
| ``ConversionTime.TIME_8_244_ms`` | 8.244 ms |
+----------------------------------+------------------+
+----------------------------------+------------------+
| ``ConversionTime`` | Time |
+==================================+==================+
| ``ConversionTime.TIME_140_us`` | 140 us |
+----------------------------------+------------------+
| ``ConversionTime.TIME_204_us`` | 204 us |
+----------------------------------+------------------+
| ``ConversionTime.TIME_332_us`` | 332 us |
+----------------------------------+------------------+
| ``ConversionTime.TIME_558_us`` | 588 us |
+----------------------------------+------------------+
| ``ConversionTime.TIME_1_1_ms`` | 1.1 ms (Default) |
+----------------------------------+------------------+
| ``ConversionTime.TIME_2_116_ms`` | 2.116 ms |
+----------------------------------+------------------+
| ``ConversionTime.TIME_4_156_ms`` | 4.156 ms |
+----------------------------------+------------------+
| ``ConversionTime.TIME_8_244_ms`` | 8.244 ms |
+----------------------------------+------------------+

"""

Expand All @@ -129,25 +112,25 @@ class ConversionTime:
class AveragingCount:
"""Options for ``averaging_count``

+-------------------------------+------------------------------------+
| ``AveragingCount`` | Number of measurements to average |
+===============================+====================================+
| ``AveragingCount.COUNT_1`` | 1 (Default) |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_4`` | 4 |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_16`` | 16 |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_64`` | 64 |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_128`` | 128 |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_256`` | 256 |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_512`` | 512 |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_1024`` | 1024 |
+-------------------------------+------------------------------------+
+-------------------------------+------------------------------------+
| ``AveragingCount`` | Number of measurements to average |
+===============================+====================================+
| ``AveragingCount.COUNT_1`` | 1 (Default) |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_4`` | 4 |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_16`` | 16 |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_64`` | 64 |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_128`` | 128 |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_256`` | 256 |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_512`` | 512 |
+-------------------------------+------------------------------------+
| ``AveragingCount.COUNT_1024`` | 1024 |
+-------------------------------+------------------------------------+

"""

Expand All @@ -167,8 +150,8 @@ class AveragingCount:
class INA260:
"""Driver for the INA260 power and current sensor.

:param ~busio.I2C i2c_bus: The I2C bus the INA260 is connected to.
:param address: The I2C device address for the sensor. Default is ``0x40``.
:param ~busio.I2C i2c_bus: The I2C bus the INA260 is connected to.
:param address: The I2C device address for the sensor. Default is ``0x40``.

"""

Expand Down
3 changes: 3 additions & 0 deletions docs/_static/favicon.ico.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries

SPDX-License-Identifier: CC-BY-4.0
3 changes: 3 additions & 0 deletions docs/api.rst.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: MIT
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# -*- coding: utf-8 -*-

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: MIT

import os
import sys

Expand Down
3 changes: 3 additions & 0 deletions docs/examples.rst.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: MIT
3 changes: 3 additions & 0 deletions docs/index.rst.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: MIT
3 changes: 3 additions & 0 deletions examples/ina260_averaging.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

import time
import board
from adafruit_ina260 import INA260, AveragingCount
Expand Down
3 changes: 3 additions & 0 deletions examples/ina260_modes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

import time
import board
from adafruit_ina260 import INA260, Mode
Expand Down
3 changes: 3 additions & 0 deletions examples/ina260_simpletest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

import time
import board
import adafruit_ina260
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense

Adafruit-Blinka
adafruit-circuitpython-busdevice
adafruit-circuitpython-register
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: MIT

"""A setuptools based setup module.

See:
Expand Down