Skip to content
Snippets Groups Projects

Fix output_list

Merged Loic Hausammann requested to merge fix_output_list into master
1 unresolved thread

I have implemented your suggestion and found a bug @pdraper, @matthieu

Merge request reports

Approval is optional

Merged by avatar (May 28, 2025 7:01pm UTC)

Merge details

  • Changes merged into master with 11c22cf2.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
102 105 /* Transform input into correct time (e.g. ages or scale factor) */
103 106 if (type == OUTPUT_LIST_REDSHIFT) *time = 1. / (1. + *time);
104 107
105 if (type == OUTPUT_LIST_AGE)
108 if (cosmo && type == OUTPUT_LIST_AGE)
  • I had removed the cosmo here since we already test above whether we have cosmo and ages. But if you'd rather keep it, that's fine.

  • You check if cosmo with redshift or scale factor, but not with the cosmic time (maybe I should change the flag OUTPUT_LIST_AGE to OUTPUT_LIST_COSMIC_TIME?). Here I do not want to compute the scale factor from the cosmic time in a non cosmological simulation. In current master, the code just crash on a segmentation fault in this case.

  • Please register or sign in to reply
  • Continuing the discussion about the header from !560 (merged). I did wonder about defining the type of the file in the parameter file (string instead of a boolean), which would be tidy, but having it in the file is also good documentation, so decided Loic's method was OK. One further thought (which was the part that unsettled me at first glance) was the need for two words with one blank between them, in the header. You could reasonably just look for the first one as sufficient, so then I thought about breaking the header into words and testing those. Getting seriously over engineered... So strcasecmp instead.

  • The idea of having # is to clearly set it as a comment for most csv reader. In this way, someone can easily read the file with numpy.

  • Peter W. Draper mentioned in commit 11c22cf2

    mentioned in commit 11c22cf2

  • Thanks looks like an improvement, so accepting. When you find a moment I'd like to see a test for this code, if possible, and maybe update the documentation to say that the headers should be written as shown.

  • Please register or sign in to reply
    Loading