Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/fix-qmax-update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Fixed load new parsed data with updated `Qmax` attribute

**Security:**

* <news item>
15 changes: 9 additions & 6 deletions src/diffpy/srfit/fitbase/profilegenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,18 @@ def set_profile(self, profile):
will store the calculated signal.
"""
if self.profile is not None:
self.profile.removeObserver(self._flush)
self.profile.removeObserver(self._on_profile_changed)

self.profile = profile
self.profile.addObserver(self._flush)
self._flush(other=(self,))
self.profile.addObserver(self._on_profile_changed)
self._on_profile_changed(other=(self,))
return

# Merge the profiles metadata with our own
self.meta.update(self.profile.meta)
self.processMetaData()
def _on_profile_changed(self, other=()):
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.

Let's call this _on_profile_update maybe?

if self.profile is not None:
self.meta.update(self.profile.meta)
self.processMetaData()
self._flush(other=other)
return

def processMetaData(self):
Expand Down
Loading