-
-
Notifications
You must be signed in to change notification settings - Fork 427
add a iter_project_parameters to make the related functions more efficient #2695
Copy link
Copy link
Closed
Labels
Good First IssueBug or feature with trivial solution that awaits you to be fixed!Bug or feature with trivial solution that awaits you to be fixed!New FeatureNew feature request [class->Implemented #{number}: {title}]New feature request [class->Implemented #{number}: {title}]Python APIIssues related to pyrevit as a python module [subsystem]Issues related to pyrevit as a python module [subsystem]pythonPull requests that update Python codePull requests that update Python code
Metadata
Metadata
Assignees
Labels
Good First IssueBug or feature with trivial solution that awaits you to be fixed!Bug or feature with trivial solution that awaits you to be fixed!New FeatureNew feature request [class->Implemented #{number}: {title}]New feature request [class->Implemented #{number}: {title}]Python APIIssues related to pyrevit as a python module [subsystem]Issues related to pyrevit as a python module [subsystem]pythonPull requests that update Python codePull requests that update Python code
Is your feature request related to a problem? Please describe
get_project_paramtersreturns a list of parameters, but the functions below that uses it only need an iterator to get the requested item.https://github.com/pyrevitlabs/pyRevit/blob/develop/pyrevitlib/pyrevit/revit/db/query.py#L792-L858
Describe the solution you'd like
iter_project_parametersfunction with the content of the currentget_project_parametersbut withyieldinstead of the list generationget_project_partameterstoreturn list(iter_project_parameters)iter_project_parametersin the functions belowAlso,
model_has_parameterdoesn't really return a boolean, we should add ais not Noneat the end of the return line.Additional context
There might be other situations like this in the code, no need to waste memory with lists to only get one (or some) item!