Skip to content

Commit

Permalink
Initial version of rme report filters section
Browse files Browse the repository at this point in the history
  • Loading branch information
r-k-g authored and philipbaileynar committed Aug 27, 2024
1 parent 3159764 commit 34fcc87
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/rme/rme/rme_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,27 @@ def metrics_plots(self, parent_section):
plot_wrapper.append(card)
section.append(plot_wrapper)

def filters_section(self, parent_section):
filter_name_pretty = self.filter_name.replace('_', ' ').title()

p = ET.Element('p')
p.text = f"The report has been filtered to only show data for {filter_name_pretty} lands."
parent_section.append(p)

# Brief section about the technical details of the filter; the specific sql query
p1 = ET.Element('p')
p1.text = "The filter is applied by using the following SQL query:"
parent_section.append(p1)

pre = ET.Element('pre')
pre.text = self.sql_filter
parent_section.append(pre)

def report_content(self):
if self.filter_name is not None:
section_filters = self.section('Filters', 'Filters')
self.filters_section(section_filters)

realization = self.xml_project.XMLBuilder.find('Realizations').find('Realization')

section_in = self.section('Inputs', 'Inputs')
Expand Down

0 comments on commit 34fcc87

Please sign in to comment.