Skip to content

function reconsturct_data #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 9, 2023
Merged

Conversation

aajayi-21
Copy link
Contributor

No description provided.

@aajayi-21
Copy link
Contributor Author

There is already a function named reconstruct_data. I am replacing it with a function with the same name.

@aajayi-21 aajayi-21 marked this pull request as ready for review August 14, 2023 17:48
Copy link
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.

A think of very great beauty!!! your code is now much more readable and therefore maintainable by others! Thank you so much.....

Please look at the last few comments and I can merge.

number_of_signal = len(components[0].weights)
data_reconstruction = np.zeros((signal_length, number_of_signal))
for signal in range(number_of_signal):
data_reconstruction[:, signal] = reconstruct_signal(components, signal)
Copy link
Contributor

Choose a reason for hiding this comment

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

as before, is there a reason the nd array is this way around and the code can't look like can't be:

data_reconstruction[signal] = reconstruct_signal(components, signal)

to make the code prettier?

Copy link
Contributor Author

@aajayi-21 aajayi-21 Aug 15, 2023

Choose a reason for hiding this comment

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

Other functions use what this function returns later. It's possible that I could make it the other way here, and transpose the output when it is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function is ready to be merged. Unless you think that I should rewrite this line in the way that you suggested.

@sbillinge sbillinge merged commit 3256040 into diffpy:main Oct 9, 2023
@sbillinge
Copy link
Contributor

Thanks Ade

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