Skip to content

Commit

Permalink
reduce code complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
andped10 committed Nov 21, 2024
1 parent c169b8d commit 2afb8dc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/easyreflectometry/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,19 @@ def parameters(self) -> List[Parameter]:

@property
def count_free_parameters(self) -> int:
return sum(1 for parameter in self.parameters if parameter.free)
count = 0
for parameter in self.parameters:
if parameter.free:
count += 1
return count

@property
def count_fixed_parameters(self) -> int:
return sum(1 for parameter in self.parameters if not parameter.free)
count = 0
for parameter in self.parameters:
if not parameter.free:
count += 1
return count

@property
def count_parameter_user_constraints(self) -> int:
Expand Down

0 comments on commit 2afb8dc

Please sign in to comment.