Skip to content

Commit d09ef88

Browse files
committed
Minor formatting fixes
1 parent 7c2cfc3 commit d09ef88

3 files changed

Lines changed: 74 additions & 79 deletions

File tree

sasdata/metadata.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ def from_json(obj):
569569

570570
@property
571571
def id_header(self):
572+
"""Generate a header for used in the unique_id for datasets"""
572573
title = ""
573574
if self.title is not None:
574575
title = self.title

sasdata/quantities/quantity.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ def variance(self) -> "Quantity":
11441144
return Quantity(self._variance, self.units**2)
11451145

11461146
def _base62_hash(self) -> str:
1147-
# Encode the number in base62 for better readability
1147+
"""Encode the hash_value in base62 for better readability"""
11481148
hashed = ""
11491149
current_hash = self.hash_value
11501150
while current_hash:
@@ -1160,6 +1160,7 @@ def _base62_hash(self) -> str:
11601160

11611161
@property
11621162
def unique_id(self) -> str:
1163+
"""Get a human readable unique id for a data set"""
11631164
return f"{self._id_header}:{self.name}:{self._base62_hash()}"
11641165

11651166
def standard_deviation(self) -> "Quantity":
@@ -1446,7 +1447,10 @@ def __repr__(self):
14461447

14471448
def to_units_of(self, new_units: Unit) -> "NamedQuantity[QuantityType]":
14481449
new_value, new_error = self.in_units_of_with_standard_error(new_units)
1449-
return NamedQuantity(value=new_value, units=new_units, standard_error=new_error, name=self.name)
1450+
return NamedQuantity(value=new_value,
1451+
units=new_units,
1452+
standard_error=new_error,
1453+
name=self.name)
14501454

14511455
def with_standard_error(self, standard_error: Quantity):
14521456
if standard_error.units.equivalent(self.units):
@@ -1467,7 +1471,6 @@ def with_standard_error(self, standard_error: Quantity):
14671471
def string_repr(self):
14681472
return self.name
14691473

1470-
14711474
class DerivedQuantity[QuantityType](Quantity[QuantityType]):
14721475
def __init__(self, value: QuantityType, units: Unit, history: QuantityHistory):
14731476
super().__init__(value, units, standard_error=None)

0 commit comments

Comments
 (0)