Skip to content

List of dicts go in separate table#2073

Open
EshitaJoshi wants to merge 4 commits intomainfrom
format-list-of-dicts
Open

List of dicts go in separate table#2073
EshitaJoshi wants to merge 4 commits intomainfrom
format-list-of-dicts

Conversation

@EshitaJoshi
Copy link
Collaborator

@EshitaJoshi EshitaJoshi commented Mar 10, 2026

Current formatting of parameter values that are a list of dictionaries is very ugly:

image

Instead, format the list of dictionaries as a table and link the table in the parameter value column like here:

image

@ctao-sonarqube
Copy link

Copy link
Collaborator

@tobiaskleiner tobiaskleiner left a comment

Choose a reason for hiding this comment

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

Thanks @EshitaJoshi for the PR. One comment or suggestion added but nothing that would prevent a merge.

description = plot_descriptions.get(parameter, "Parameter plot")
file.write(f"![{description}.]({image_path.as_posix()})")

def _write_dict_table(self, parameter, file, value_data, unit):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this logic can largely be replaced by using astropy tables, which handles list-of-dicts to table conversion and can output Markdown directly. It would also help the code to be more stable to inconsistent keys across entries and has unit handling instead of string concatenation.

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