Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 2, 2024
1 parent d64eb1c commit d0967c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
12 changes: 3 additions & 9 deletions spmpy/nanonispy/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class NanonisFile:

"""
Base class for Nanonis data files (grid, scan, point spectroscopy).
Expand Down Expand Up @@ -145,7 +144,6 @@ def set_data_format(self, data_format):


class Grid(NanonisFile):

"""
Nanonis grid file class.
Expand Down Expand Up @@ -284,7 +282,6 @@ def _extract_topo(self):


class Scan(NanonisFile):

"""
Nanonis scan file class.
Expand Down Expand Up @@ -374,7 +371,6 @@ def _load_data(self):


class Spec(NanonisFile):

"""
Nanonis point spectroscopy file class.
Expand Down Expand Up @@ -442,14 +438,12 @@ def _num_header_lines(self):


class UnhandledFileError(Exception):

"""
To be raised when unknown file extension is passed.
"""


class FileHeaderNotFoundError(Exception):

"""
To be raised when no header information could be determined.
"""
Expand Down Expand Up @@ -484,9 +478,9 @@ def _parse_3ds_header(header_raw, header_override):

if header_override is not None:
for key, val in header_override.items():
raw_dict[
key
] = val # creates new entry if key doesn't match key in raw_dict
raw_dict[key] = (
val # creates new entry if key doesn't match key in raw_dict
)

# Transfer parameters from raw_dict to header_dict
# Get the expected parameters first
Expand Down
18 changes: 9 additions & 9 deletions spmpy/spm.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ def __init__(self, path: str, config_file=DEFAULT_CONFIG):
self.SignalsList.append(
{
"ChannelName": key,
"ChannelNickname": config["Channels"][key]["nickname"]
if in_config
else key,
"ChannelScaling": config["Channels"][key]["scaling"]
if in_config
else 1.0,
"ChannelUnit": config["Channels"][key]["unit"]
if in_config
else "N/A",
"ChannelNickname": (
config["Channels"][key]["nickname"] if in_config else key
),
"ChannelScaling": (
config["Channels"][key]["scaling"] if in_config else 1.0
),
"ChannelUnit": (
config["Channels"][key]["unit"] if in_config else "N/A"
),
}
)

Expand Down

0 comments on commit d0967c9

Please sign in to comment.