MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / is_line_in_selected_list

Method is_line_in_selected_list

pyxrf/model/lineplot.py:812–837  ·  view source on GitHub ↗

Checks if the line with ID ``n_id`` is in the list of selected element lines. Used to enable/disable 'Add Line' and 'Remove Line' buttons. Parameters ---------- n_id : Int index of the element emission line in the list (often

(self, n_id)

Source from the content-addressed store, hash-verified

810 data = self.io_model.data
811
812 def is_line_in_selected_list(self, n_id):
813 """
814 Checks if the line with ID ``n_id`` is in the list of
815 selected element lines.
816 Used to enable/disable 'Add Line' and 'Remove Line' buttons.
817
818 Parameters
819 ----------
820
821 n_id : Int
822 index of the element emission line in the list
823 (often equal to ``self.element_id``)
824
825 Returns True if the element line
826 is in the list of selected lines. False otherwise.
827 """
828
829 ename = self.get_element_line_name_by_id(n_id)
830
831 if ename is None:
832 return False
833
834 if self.param_model.EC.is_element_in_list(ename):
835 return True
836 else:
837 return False
838
839 def is_element_line_id_valid(self, n_id):
840 """

Callers 1

Calls 2

is_element_in_listMethod · 0.80

Tested by

no test coverage detected