Skip to content

HDFWriterMixin duplicates virtual-packet properties on repeated access #3732

Done

Description

@1sakshm

Describe the bug

HDFWriterMixin.full_hdf_properties mutates self.hdf_properties whenever virt_logging is enabled. Each property access appends vpacket_hdf_properties again, so repeated serialization or inspection duplicates entries and grows instance state indefinitely.

Minimal reproduction

from tardis.io.hdf_writer_mixin import HDFWriterMixin


class Example(HDFWriterMixin):
    hdf_properties = ["base"]
    vpacket_hdf_properties = ["virtual"]

    def __init__(self):
        self.virt_logging = True
        self.base = 1
        self.virtual = 2


example = Example()
print(example.full_hdf_properties)
print(example.full_hdf_properties)
print(example.hdf_properties)

Actual output:

["base", "virtual"]
["base", "virtual", "virtual"]
["base", "virtual", "virtual"]

Expected behavior

Accessing full_hdf_properties should be idempotent: it should return the base and virtual-packet properties without modifying hdf_properties.

Suggested direction

Build and return a combined list rather than extending the instance list in the property getter.

Activity

  1. Angel-Gupta037 commented on Sep 12, 2026

    @Angel-Gupta037
    Contributor

    hi, I would like to work on this. I'll submit the PR soon!

  2. andrewfullard commented on Nov 24, 2026

    @andrewfullard
    Contributor

    Fixed through removal in #3799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions