Skip to content

function construct_stretching_matrix#38

Merged
sbillinge merged 5 commits intodiffpy:mainfrom
aajayi-21:construct_stretching
Aug 2, 2023
Merged

function construct_stretching_matrix#38
sbillinge merged 5 commits intodiffpy:mainfrom
aajayi-21:construct_stretching

Conversation

@aajayi-21
Copy link
Copy Markdown
Contributor

No description provided.

created construct_stretching_matrix, test, and docstring
Copy link
Copy Markdown
Contributor

@sbillinge sbillinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see comments

Comment thread diffpy/snmf/subroutines.py Outdated
if number_of_signals == 0:
raise ValueError(f"Number of signals = {number_of_signals}. Number_of_signals must be >= 1.")
stretching_factor_matrix = np.zeros((number_of_components, number_of_signals))
for c in components:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about

for i, component in enumerate(components):
    stretching_factor_matrix[i] = component.stretching_factors

I think it is easier to read and should work ok.

Made exception condition more robust, changed for loop iterable, specified tests raising expected exception
@aajayi-21 aajayi-21 marked this pull request as ready for review August 2, 2023 18:14
@sbillinge sbillinge merged commit f03ac68 into diffpy:main Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants