Skip to content
Snippets Groups Projects

Enable pickle compatibility for ligo.p_astro.Posterior class

Open Daniel Tang requested to merge spiir-group/p-astro:feature/enable_pickle_compat into master

This change implements the solution outlined in Issue #21, where dictionary keys and values stored on the Posterior class as attributes are instead stored as lists.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Daniel Tang mentioned in merge request spiir!89 (merged)

    mentioned in merge request spiir!89 (merged)

  • Daniel Tang mentioned in issue #21

    mentioned in issue #21

  • Hi @lscsoft p-astro - I'd just like to bump this merge request so that SPIIR no longer has to maintain their own fork of p-astro.

    Context

    The LIGO reviewers for the SPIIR project recommended that we use this LIGO repository (as it is already reviewed etc.) rather than rewriting the same p-astro implementation from scratch, and so we'd very much like to continue using this repository for our current O4 needs (and clean up the unnecessary fork).

    Changes

    All we need is this two line change merged. I believe it is simple enough to verify from all uses of the self.args_all and self.keys_fixed attributes that downstream code should not be affected by this list function call we've used.

    We've been using this code for almost 6 months now and we have run into no errors associated with this change.

    self.args_all

    For those familiar with Python, the only uses of self.args_all is either as an iterator ([arg.label for arg in self.args_all]), a call to len() (which accesses the object's __len__ method), and a cast to set. These three access patterns function exactly the same whether it is a list or dict_keys type.

    self.keys_fixed

    This attribute is used in exactly the same manner as self.args_all, and so the logic holds.

    Edited by Daniel Tang
  • mentioned in merge request spiir-group/spiir!40 (merged)

Please register or sign in to reply
Loading