Skip to content

Commit b6c0eae

Browse files
[pre-commit.ci lite] apply automatic fixes for ruff linting errors
1 parent 1c4aacc commit b6c0eae

65 files changed

Lines changed: 286 additions & 283 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sasdata/ascii_reader_metadata.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import re
21
from dataclasses import dataclass, field
3-
from typing import TypeVar
42
from re import split as re_split
3+
from typing import TypeVar
54

65
initial_metadata = {
76
'source': ['name', 'radiation', 'type', 'probe_particle', 'beam_size_name', 'beam_size', 'beam_shape', 'wavelength', 'wavelength_min', 'wavelength_max', 'wavelength_spread'],

sasdata/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22

33

4-
from sasdata.quantities.quantity import NamedQuantity
54
from sasdata.metadata import Metadata
5+
from sasdata.quantities.quantity import NamedQuantity
66

77

88
class SasData:
@@ -30,7 +30,7 @@ def summary(self, indent = " ", include_raw=False):
3030
for data in self._data_contents:
3131
s += f"{indent}{data}\n"
3232

33-
s += f"Metadata:\n"
33+
s += "Metadata:\n"
3434
s += "\n"
3535
s += self.metadata.summary()
3636

sasdata/data_backing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from typing import TypeVar, Self
21
from dataclasses import dataclass
32
from enum import Enum
3+
from typing import Self, TypeVar
44

55
from sasdata.quantities.quantity import NamedQuantity
66

@@ -123,4 +123,4 @@ def key_tree(data: Group | Dataset, indent_amount=0, indent: str = " ") -> str:
123123
s += indent*indent_amount + key + "\n"
124124
s += key_tree(data.attributes[key], indent_amount=indent_amount+1, indent=indent)
125125

126-
return s
126+
return s

sasdata/dataloader/readers/cansas_reader_HDF5.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@
99

1010
import h5py
1111
import numpy as np
12-
import re
13-
import traceback
14-
from typing import Any, Union, Optional
1512

16-
from sasdata.dataloader.data_info import plottable_1D, plottable_2D, Data1D, Data2D, DataInfo, Process, Aperture,\
17-
Collimation, TransmissionSpectrum, Detector
1813
from sasdata.data_util.loader_exceptions import FileContentsException
14+
from sasdata.dataloader.data_info import (
15+
Aperture,
16+
Collimation,
17+
Data1D,
18+
Data2D,
19+
DataInfo,
20+
Detector,
21+
Process,
22+
TransmissionSpectrum,
23+
plottable_1D,
24+
plottable_2D,
25+
)
1926
from sasdata.dataloader.filereader import FileReader, decode
2027

2128
logger = logging.getLogger(__name__)

sasdata/dataloader/readers/danse_reader.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#copyright 2008, University of Tennessee
1313
#############################################################################
1414
import os
15-
import os
1615

1716
import numpy as np
1817

sasdata/fair_database/data/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from django.contrib import admin
21
from data import models
2+
from django.contrib import admin
33

44
admin.site.register(models.DataFile)
55
admin.site.register(models.Session)

sasdata/fair_database/data/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from django import forms
21
from data.models import DataFile
2+
from django import forms
33

44

55
# Create the form class.

sasdata/fair_database/data/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from django.db import models
21
from django.contrib.auth.models import User
32
from django.core.files.storage import FileSystemStorage
3+
from django.db import models
44

55

66
# method for empty list default value

sasdata/fair_database/data/serializers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
from django.core.exceptions import ObjectDoesNotExist
2-
from rest_framework import serializers
3-
41
from data import models
2+
from django.core.exceptions import ObjectDoesNotExist
53
from fair_database import permissions
6-
4+
from rest_framework import serializers
75

86
# TODO: more custom validation, particularly for specific nested dictionary structures
97
# TODO: custom update methods for nested structures

sasdata/fair_database/data/test/test_datafile.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import os
22
import shutil
33

4+
from data.models import DataFile
45
from django.conf import settings
5-
from django.test import TestCase
6-
from django.db.models import Max
76
from django.contrib.auth.models import User
8-
from rest_framework.test import APIClient, APITestCase
7+
from django.db.models import Max
8+
from django.test import TestCase
99
from rest_framework import status
10-
11-
from data.models import DataFile
10+
from rest_framework.test import APIClient, APITestCase
1211

1312

1413
# path to a file in example_data/1d_data

0 commit comments

Comments
 (0)