Skip to content

Commit a608010

Browse files
mrobers1982midhun-pm
authored andcommitted
fix rye format / lint errors
1 parent 7267896 commit a608010

13 files changed

+71
-215
lines changed

libs/lbox-alignerr/src/alignerr/alignerr_project.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ class AlignerrRole(Enum):
3333

3434

3535
class AlignerrProject:
36-
def __init__(
37-
self, client: "Client", project: "Project", _internal: bool = False
38-
):
36+
def __init__(self, client: "Client", project: "Project", _internal: bool = False):
3937
if not _internal:
4038
raise RuntimeError(
4139
"AlignerrProject cannot be initialized directly. "

libs/lbox-alignerr/src/alignerr/alignerr_project_builder.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ def set_project_owner(self, project_owner_email: str):
169169
self._project_owner_email = project_owner_email
170170
return self
171171

172-
def create(
173-
self, skip_validation: Union[bool, List[ValidationType]] = False
174-
):
172+
def create(self, skip_validation: Union[bool, List[ValidationType]] = False):
175173
if not skip_validation:
176174
self._validate()
177175
elif isinstance(skip_validation, list):
@@ -205,9 +203,7 @@ def _create_rates(self, alignerr_project: "AlignerrProject"):
205203

206204
def _create_domains(self, alignerr_project: "AlignerrProject"):
207205
if self._domains:
208-
logger.info(
209-
f"Setting domains: {[domain.name for domain in self._domains]}"
210-
)
206+
logger.info(f"Setting domains: {[domain.name for domain in self._domains]}")
211207
domain_ids = [domain.uid for domain in self._domains]
212208
ProjectDomain.connect_project_to_domains(
213209
client=self.client,
@@ -263,9 +259,7 @@ def _validate_alignerr_rates(self):
263259
for role_name in self._alignerr_rates.keys():
264260
required_role_rates.remove(role_name)
265261
if len(required_role_rates) > 0:
266-
raise ValueError(
267-
f"Required role rates are not set: {required_role_rates}"
268-
)
262+
raise ValueError(f"Required role rates are not set: {required_role_rates}")
269263

270264
def _validate_customer_rate(self):
271265
if self._customer_rate is None:

libs/lbox-alignerr/src/alignerr/alignerr_project_factory.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ class AlignerrProjectFactory:
1919
def __init__(self, client: "Client"):
2020
self.client = client
2121

22-
def create(
23-
self, yaml_file_path: str, skip_validation: Union[bool, List] = False
24-
):
22+
def create(self, yaml_file_path: str, skip_validation: Union[bool, List] = False):
2523
"""
2624
Create an AlignerrProject from a YAML configuration file.
2725
@@ -153,10 +151,7 @@ def create(
153151
)
154152

155153
effective_until = None
156-
if (
157-
"effective_until" in rate_config
158-
and rate_config["effective_until"]
159-
):
154+
if "effective_until" in rate_config and rate_config["effective_until"]:
160155
try:
161156
effective_until = datetime.datetime.fromisoformat(
162157
rate_config["effective_until"]
@@ -208,7 +203,7 @@ def create(
208203
)
209204
except ValueError:
210205
raise ValueError(
211-
f"Invalid effective_since date format for customer_rate. Use ISO format (YYYY-MM-DDTHH:MM:SS)"
206+
"Invalid effective_since date format for customer_rate. Use ISO format (YYYY-MM-DDTHH:MM:SS)"
212207
)
213208

214209
effective_until = None
@@ -222,7 +217,7 @@ def create(
222217
)
223218
except ValueError:
224219
raise ValueError(
225-
f"Invalid effective_until date format for customer_rate. Use ISO format (YYYY-MM-DDTHH:MM:SS)"
220+
"Invalid effective_until date format for customer_rate. Use ISO format (YYYY-MM-DDTHH:MM:SS)"
226221
)
227222

228223
# Set the customer rate
@@ -257,9 +252,7 @@ def create(
257252
required_tag_fields = ["text", "type"]
258253
for field in required_tag_fields:
259254
if field not in tag_config:
260-
raise ValueError(
261-
f"Required field '{field}' is missing for tag"
262-
)
255+
raise ValueError(f"Required field '{field}' is missing for tag")
263256

264257
# Validate tag type
265258
try:
@@ -276,9 +269,7 @@ def create(
276269
if "project_owner" in config:
277270
project_owner_config = config["project_owner"]
278271
if not isinstance(project_owner_config, str):
279-
raise ValueError(
280-
"'project_owner' must be a string (email address)"
281-
)
272+
raise ValueError("'project_owner' must be a string (email address)")
282273

283274
builder.set_project_owner(project_owner_config)
284275

libs/lbox-alignerr/src/alignerr/schema/project_boost_workforce.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ class ProjectBoostWorkforce(DbObject):
143143
projectDifficulty = Field.Enum(ProjectDifficulty, "projectDifficulty")
144144
projectDescription = Field.String("projectDescription")
145145
estimatedTimePerLabel = Field.Float("estimatedTimePerLabel")
146-
disabledCountryRateMultipliers = Field.Boolean(
147-
"disabledCountryRateMultipliers"
148-
)
146+
disabledCountryRateMultipliers = Field.Boolean("disabledCountryRateMultipliers")
149147
billingMode = Field.Enum(BillingMode, "billingMode")
150148
customerBillingMode = Field.Enum(BillingMode, "customerBillingMode")
151149
type = Field.Enum(ProjectBoostType, "type")
@@ -236,12 +234,8 @@ def update(
236234
}
237235
}"""
238236

239-
result = client.execute(
240-
mutation_str, {"data": update_input.model_dump()}
241-
)
242-
return ProjectBoostWorkforceResult(
243-
**result["updateProjectBoostWorkforce"]
244-
)
237+
result = client.execute(mutation_str, {"data": update_input.model_dump()})
238+
return ProjectBoostWorkforceResult(**result["updateProjectBoostWorkforce"])
245239

246240
@classmethod
247241
def set_project_owner(

libs/lbox-alignerr/src/alignerr/schema/project_domain.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,7 @@ def get_by_project_id(
208208
Returns:
209209
PaginatedCollection of ProjectDomain instances
210210
"""
211-
query_str = cls.query_by_project_id(
212-
project_id, limit, offset, include_archived
213-
)
211+
query_str = cls.query_by_project_id(project_id, limit, offset, include_archived)
214212

215213
params: Dict[str, Any] = {
216214
"projectId": project_id,

libs/lbox-alignerr/src/alignerr/schema/project_rate.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ def validate_fields(self):
3131
)
3232

3333
if not self.isBillRate and self.rateForId == "":
34-
raise ValueError(
35-
"rateForId must be set to the id of the Alignerr Role"
36-
)
34+
raise ValueError("rateForId must be set to the id of the Alignerr Role")
3735

3836
return self
3937

@@ -53,9 +51,7 @@ class ProjectRateV2(DbObject, Deletable):
5351
effectiveUntil = Field.DateTime("effectiveUntil")
5452

5553
@classmethod
56-
def get_by_project_id(
57-
cls, client, project_id: str
58-
) -> list["ProjectRateV2"]:
54+
def get_by_project_id(cls, client, project_id: str) -> list["ProjectRateV2"]:
5955
query_str = """
6056
query GetAllProjectRatesPyApi($projectId: ID!) {
6157
project(where: { id: $projectId }) {

0 commit comments

Comments
 (0)