Skip to content

implement LArray.from_dict or from_dict top-level function #581

Open

Description

@gdementen
def from_dict(d):
    return LArray(list(d.values()), Axis(d.keys()))

Activity

  1. gdementen commented on Feb 15, 2018

    @gdementen
    ContributorAuthor

    and/or modify behavior of LArray(dict) which currently creates a "scalar" LArray with the dict, which is a bit weird.

  2. added this to the 0.29 milestone on Feb 16, 2018
  3. self-assigned this
    on Mar 1, 2018
  4. gdementen commented on Jul 4, 2018

    @gdementen
    ContributorAuthor

    stack(d) could work for this use case, but it currently does not.
    It assumes that if we pass a dict, we need a real Axis object (to get labels order). On Python 3.7, this is no longer a necessary precaution. And even on Python < 3.7, this is annoying when you do not care about the order. Maybe changing the assert into a warning for python < 3.7 would be the right move, or even no warning in the code but a warning in the doc? After all when you iterate on a dict it does not output a warning.

  5. removed this from the 0.29 milestone on Jul 4, 2018
  6. changed the title [-]implement LArray.from_dict[/-] [+]implement LArray.from_dict or add support for simple dict in stack[/+] on Jul 4, 2018
  7. alixdamman commented on Jul 4, 2018

    @alixdamman
    Collaborator

    As long as we add one or several examples, no warnings at all seems fine to me.

  8. removed their assignment
    on Jul 4, 2018
  9. added this to the 0.31 milestone on Dec 21, 2018
  10. modified the milestones: 0.31, 0.30 on Apr 4, 2019
  11. added 2 commits that reference this issue on Jun 20, 2019
    3180d0d
    699d53c
  12. gdementen commented on Jun 26, 2019

    @gdementen
    ContributorAuthor

    @alixdamman the functionality is now in stack, but LArray.from_dict might be more readable/more discoverable, so we might want to add it as a simple alias anyway. Thoughts?

  13. alixdamman commented on Jun 26, 2019

    @alixdamman
    Collaborator

    stack is really generic and so yes, it would be nice to have an explicit alias.

  14. changed the title [-]implement LArray.from_dict or add support for simple dict in stack[/-] [+]implement LArray.from_dict or from_dict top-level function[/+] on Jun 26, 2019
  15. removed this from the 0.31 milestone on Aug 1, 2019
  16. added this to the nice_to_have milestone on Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions