Skip to content

Conversation

Copy link

Copilot AI commented Dec 12, 2025

The HDFConverter.__init__ calls self.convert_psp_to_hdf5() with no arguments, but the method was decorated as @staticmethod and expected an inputfilename parameter.

Changes

  • Converted convert_psp_to_hdf5, print_component_header, and make_phasespace from static methods to instance methods
  • Methods now use self.filename instead of taking filename as a parameter
  • Updated docstring example from HDFConverter.convert_psp_to_hdf5(args.filename) to HDFConverter(args.filename)

Before

def __init__(self, filename, comp=None, verbose=0):
    self.filename = filename
    self.convert_psp_to_hdf5()  # Called with no args

@staticmethod
def convert_psp_to_hdf5(inputfilename):  # But expects inputfilename
    outputfilename = inputfilename + '.h5'
    # ...

After

def __init__(self, filename, comp=None, verbose=0):
    self.filename = filename
    self.convert_psp_to_hdf5()

def convert_psp_to_hdf5(self):  # Now uses self.filename
    outputfilename = self.filename + '.h5'
    # ...

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: michael-petersen <19195541+michael-petersen@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP to address feedback on Draft HDF5 converter PR Fix HDFConverter static method inconsistency Dec 12, 2025
@michael-petersen michael-petersen marked this pull request as ready for review December 12, 2025 12:01
@michael-petersen michael-petersen merged commit b345165 into hdf5 Dec 12, 2025
@michael-petersen michael-petersen deleted the copilot/sub-pr-29-another-one branch December 12, 2025 12:01
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