Releases: hollenstein/xlsxreport
Releases · hollenstein/xlsxreport
v0.1.0 - Interface and template rewrite
Released: 2024-04-23
This release introduces a new public interface for reading YAML template files, applying the template to a table (which now creates compiled table sections), and for writing compiled table sections to an Excel worksheet. In addition, with the ReportBuilder class a convenient high-level interface is introduced for creating (multi-tab) Excel reports from tables and table templates. Moreover, the YAML table templates have been partially redesigned, breaking backward compatibility.
Changelog
Added
- The
TableTemplateclass serves as the representation of a YAML template file in Python. It provides methods for both loading a YAML template file and saving to a YAML template file.- When creating a
TableTemplateinstance, the template is checked for type errors. If type errors are detected, aValueErroris raised. - Similarly, when loading a template from a YAML file, a non-parseable YAML file or the presence of type errors will raise a
ValueError. - The
TableTemplateSectionsclass provides methods for adding, removing, and changing the order of sections from a template. - The
TableTemplateclass, and the classes for the four table template sections, provide a__str__method for viewing the content of the template.
- When creating a
- Added the
validatemodule, which offers functions for validating YAML template file integrity, checking if data types in a template are correct, and confirming that the sections and parameters of a template are in accordance with the template specifications (which is refered to as the template schema). - Add a new template section type called "label tag section". This section resembles the "tag section" but offers the ability to specify a list of additional labels for further column filtering after tag matching. It's primarily designed for in-code template creation or updating of existing sections, where the labels are known or extracted from the data.
- The column order of the "label tag section" is determined by the order of the labels in the template.
- Introduced new functionality to the
xlsxreportconsole script.- The command for generating a formatted Excel file is now
xlsxreport compile.- Added an option to open the compiled Excel file using the
--revealflag.
- Added an option to open the compiled Excel file using the
- The
xlsxreport appdircommand now reveals the location of the app directory.- Added an option to open the appdata directory in the file explorer using the
--revealflag. - Setting up the app directory can be accomplished with
xlsxreport appdir --setupwhich creates the app directory and copies default report template files.
- Added an option to open the appdata directory in the file explorer using the
- The
xlsxreport validatecommand allows validating a YAML template file, with detected issues being printed to the console. - Added color highlighting to printed messages from command line scripts and improved printed message texts.
- The command for generating a formatted Excel file is now
Changed
- (!) Changed how the
xlsxreportconsole scripts works. Now all scripts are called withxlsxreportplus a specific command. - Renamed the Excel worksheet generated by the
xlsxreport compilescript from "Proteins" to "Report". - (!) Replaced the term "config" with "template" throughout the codebase.
- (!) Replaced the template keyword "groups" with "sections" in YAML template files.
- (!) Replaced the template keyword "args" with "settings" in YAML template files.
- (!) Replaced the term "report template" with "table template", which refers to the YAML template file as well as its Python representation the
TableTemplateclass. - (!) Replaced the internally used term "TableSection" with "CompiledTableSection", to clearly distinguish between template and compiled table sections.
- Renamed
writer.TableSectionWritertowriter.SectionWriter. - Renamed
compiler.prepare_table_sectionstocompiler.prepare_compiled_sections.
- Renamed
- (!) Replaced the "tag sample section" category with a simpler "tag section".
- The "tag" parameter of the "tag section" is used as a regular expression pattern instead of simply looking for an exact match. This change allows for more flexible matching of columns and makes the additional selection of samples via a "sample_extraction_tag" obsolete.
- (!) Removed the
comparison_groupparameter from the comparison section, which is now identified by the simultaneous presence of the parameters "tag" and "columns". - (!) Renamed the template section parameter "conditional" to "conditional_format".
- (!) Renamed the template section parameter "column_conditional" to "column_conditional_format".
- Changed the default value of the "evaluate_log2_transformation" setting to False.
- Changed the default value of the "write_supheader" setting to False.
- When no supheader name is specified the supheader cells are not merged and no format is applied .
- Changed the default format from
0to the standard Excel formatGeneral. - When attempting to use an invalid format for compiling an Excel report, the compiler will now apply no format and issue a warning instead of raising an exception. This change ensures consistent behavior for both conditional and standard cell formats. This change is also reflected in the validation module. When an invalid format description is identified, it now creates an error with an error level ERROR instead of CRITICAL, indicating that the template could still be utilized to create an Excel format despite the encountered issue.
- Updated the default templates "maxquant.yaml" and "fragpipe.yaml" to reflect the changes in the template schema and to improve the clarity of the generated Excel report.
appdir.get_template_pathraisesFileNotFoundErrorinstead of returningNonewhen the specified template does not exist.
Removed
- (!) Removed the
cassiopeia_reportcommand line script. - (!) Removed the
xlsxreport_setupscript. - (!) Removed
xlsxreport.writer.Datasheetandxlsxreport.writer.Reportbook, which previously represented the public interface for creating a formatted Excel report. - (!) Removed the default templates "msreport_lfq_protein.yaml" and "cassiopeia.yaml".
- (!) Removed the "sample_extraction_tag" parameter from the table template settings.
Internal
- Replaced the
appdirslibrary withplatformdirs, asappdirsis officially deprecated.