Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change @classmethods to @staticmethods #870

Conversation

GuillermoAbadLopez
Copy link
Contributor

@GuillermoAbadLopez GuillermoAbadLopez commented Jan 14, 2025

No description provided.

Copy link

🔗Pullpo.io Slack channel

Copy link

pullpo-for-slack bot commented Jan 14, 2025

AI Analysis

Review:

Overall, the changes made in the code involve converting class methods to static methods, adding missing import statements, and fixing formatting issues. The conversion to static methods seems appropriate based on the provided information and can help in improving code clarity and reusability. The corrections made indicate a focus on improving code quality and maintainability. Great job on these enhancements!

Detailed file changes

(dropdown):

In circuit_optimizer.py:

  • In circuit_optimizer.py: The optimize_gates and cancel_pairs_of_hermitian_gates methods were changed from classmethod to staticmethod.
  • In circuit_optimizer.py: Methods bunch_drag_gates, normalize_angles_of_drags, and delete_gates_with_no_amplitude were changed from classmethod to staticmethod.

In qblox_acquisitions_builder.py:

  • Updated the class method decorators to staticmethod for 'get_scope', 'get_bins', and '_get_sequencer_with_scope_data_available'.
  • Changed the class references to 'QbloxAcquisitionsBuilder' in 'get_scope' and '_get_sequencer_with_scope_data_available' methods.

In pulse_distortion.py:

  • Added missing import statement for 'np'.
  • Updated the class method decorator to staticmethod for 'from_dict'.
  • Fixed indentation issue in the example code block.
  • Corrected the formatting of the example code block.

In circuit_router.py:

  • Updated the class method decorators to staticmethod for '_build_router'.
  • Changed the class references to 'CircuitRouter' in '_highest_degree_node' method.

In bias_tee_correction.py:

  • Added missing import statement for 'np'.
  • Updated the class method decorator to staticmethod for 'from_dict'.
  • Corrected the return statement in 'from_dict' method.

In lfilter_correction.py:

  • Changed the class method from_dict to a static method.
  • Modified the return statement in the static method from_dict.

In pulse_event.py:

  • Changed the class method from_dict to a static method.
  • Modified the return statement in the static method from_dict.

In flat_top.py:

  • Changed the class method from_dict to a static method.
  • Modified the return statement in the static method from_dict.

In rectangular.py:

  • Changed the class method from_dict to a static method.
  • Modified the return statement in the static method from_dict.

@GuillermoAbadLopez GuillermoAbadLopez changed the title Change classmethods to staticmethods Change @classmethods to @staticmethods Jan 14, 2025
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.32%. Comparing base (0a1efab) to head (1f15cd8).
Report is 1 commits behind head on adding_optimize_transpiled_gates.

Additional details and impacted files
@@                        Coverage Diff                        @@
##           adding_optimize_transpiled_gates     #870   +/-   ##
=================================================================
  Coverage                             97.32%   97.32%           
=================================================================
  Files                                   231      231           
  Lines                                  8338     8338           
=================================================================
  Hits                                   8115     8115           
  Misses                                  223      223           
Flag Coverage Δ
unittests 97.32% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@GuillermoAbadLopez GuillermoAbadLopez self-assigned this Jan 14, 2025
@GuillermoAbadLopez GuillermoAbadLopez merged commit 0d19f72 into adding_optimize_transpiled_gates Jan 14, 2025
5 of 6 checks passed
@GuillermoAbadLopez GuillermoAbadLopez deleted the changing_classmethods_to_static branch January 14, 2025 14:57
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.

1 participant