Skip to content

Commit

Permalink
Add precommit check for licenses and apply fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins committed Jun 9, 2023
1 parent 404b575 commit 9101575
Show file tree
Hide file tree
Showing 104 changed files with 517 additions and 526 deletions.
3 changes: 3 additions & 0 deletions .github/license_header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Copyright (C) 2023 Analog Devices, Inc.

SPDX short identifier: ADIBSD
3 changes: 3 additions & 0 deletions .licenserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"# Copyright (C) 2019-2023 Analog Devices, Inc.",
"#",
"# SPDX short identifier: ADIBSD"
],
"ignore": [
"adi/sshfs.py"
]
}
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,14 @@ repos:
hooks:
- id: blacken-docs
additional_dependencies: [black==19.10b0]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
hooks:
- id: insert-license
files: adi\/.*\.py$
args:
- --license-filepath
- .github/license_header.txt
- --use-current-year
- --no-extra-eol
- --detect-license-in-X-top-lines=3
2 changes: 1 addition & 1 deletion adi/QuadMxFE_multi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2021 Analog Devices, Inc.
# Copyright (C) 2021-2023 Analog Devices, Inc.
#
# SPDX short identifier: ADIBSD

Expand Down
2 changes: 1 addition & 1 deletion adi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2019 Analog Devices, Inc.
# Copyright (C) 2019-2023 Analog Devices, Inc.
#
# SPDX short identifier: ADIBSD

Expand Down
60 changes: 30 additions & 30 deletions adi/ad4020.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Copyright (C) 2022 Analog Devices, Inc.
#
# SPDX short identifier: ADIBSD

import numpy as np
from adi.context_manager import context_manager
from adi.rx_tx import rx


class ad4020(rx, context_manager):
"""AD4020 device"""

_device_name = "ad4020"
_rx_data_type = np.int32
_complex_data = False
_rx_channel_names = ["voltage0"]

def __init__(self, uri=""):

context_manager.__init__(self, uri, self._device_name)

self._rxadc = self._ctx.find_device("ad4020")
self._ctrl = self._ctx.find_device("ad4020")
rx.__init__(self)

@property
def sampling_frequency(self):
"""sample_rate: Only readable
"""
return self._get_iio_dev_attr("sampling_frequency")
# Copyright (C) 2022-2023 Analog Devices, Inc.
#
# SPDX short identifier: ADIBSD

import numpy as np
from adi.context_manager import context_manager
from adi.rx_tx import rx


class ad4020(rx, context_manager):
"""AD4020 device"""

_device_name = "ad4020"
_rx_data_type = np.int32
_complex_data = False
_rx_channel_names = ["voltage0"]

def __init__(self, uri=""):

context_manager.__init__(self, uri, self._device_name)

self._rxadc = self._ctx.find_device("ad4020")
self._ctrl = self._ctx.find_device("ad4020")
rx.__init__(self)

@property
def sampling_frequency(self):
"""sample_rate: Only readable
"""
return self._get_iio_dev_attr("sampling_frequency")
2 changes: 1 addition & 1 deletion adi/ad4110.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 Analog Devices, Inc.
# Copyright (C) 2022-2023 Analog Devices, Inc.
#
# SPDX short identifier: ADIBSD

Expand Down
2 changes: 1 addition & 1 deletion adi/ad4130.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 Analog Devices, Inc.
# Copyright (C) 2022-2023 Analog Devices, Inc.
#
# SPDX short identifier: ADIBSD

Expand Down
Loading

0 comments on commit 9101575

Please sign in to comment.