Skip to content

Prep v1.0.12 #179

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

Merged
merged 37 commits into from
May 30, 2025
Merged

Prep v1.0.12 #179

merged 37 commits into from
May 30, 2025

Conversation

jinningwang
Copy link
Member

  • Add RParam pd and qd in DCPF1 for easy access to load
  • Bug fix in RoutineBase.export_csv when path is specified
  • Fix bug in io.matpower.system2mpc with multiple PQ at one bus

@jinningwang jinningwang requested a review from Copilot May 30, 2025 00:00
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR prepares version v1.0.12 and addresses several issues while introducing new features for easier access and improved export functionality. The key changes include:

  • Adding RParam attributes pd and qd to DCPF1 in the pypower routine.
  • Fixing bugs in RoutineBase.export_csv and in io.matpower.system2mpc related to handling paths and multiple PQ loads.
  • Updating tests, examples, documentation, and CI workflows to support these changes.

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_rtn_dcopf.py Added test for export_csv functionality.
tests/test_paths.py Introduced tests for get_export_path behavior.
tests/test_io.py Added test_system2mpc_pq to verify multiple PQ handling.
examples/ex4.ipynb, demo notebooks Updated output strings and documentation in notebooks.
docs/source/release-notes.rst Updated release notes for v1.0.12 and fixed texts.
ams/utils/paths.py Added a new get_export_path function.
ams/system.py Updated export wrappers to use get_export_path and added wrapper notes.
ams/routines/routine.py Modified export_csv to use get_export_path.
ams/routines/pypower.py Added RParam pd and qd attributes for StaticLoad.
ams/io/psse.py, matpower.py, matprocessor.py Enhanced docstrings and notes in export functions.
CI config files (.github/workflows/codecov.yml, .codecov.yml, .codacy.yml) Adjusted test and coverage reporting configurations.
Comments suppressed due to low confidence (3)

ams/system.py:773

  • The function call 'wrtite_m' appears to be a typo. It likely should be 'write_m' to correctly call the intended wrapper method.
return wrtite_m(self, outfile=outfile, overwrite=overwrite)

ams/routines/pypower.py:135

  • [nitpick] The attribute name 'pd' might conflict with the commonly used alias 'pd' (e.g., for pandas) imported elsewhere. Consider renaming it (for example, to 'p_demand') to avoid potential confusion.
self.pd = RParam(info='active demand', name='pd', tex_name=r'p_{d}', model='StaticLoad', src='p0', unit='p.u.',)

ams/utils/paths.py:292

  • The function get_export_path uses 'logger' but does not import or define it. Please import logging (e.g., 'import logging' and 'logger = logging.getLogger(name)') to ensure the logger is available.
logger.info("Input file name not detected. Using `Untitled`.")

Copy link

codacy-production bot commented May 30, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.08% (target: -10.00%) 96.84% (target: 0.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6d7b555) 9501 7268 76.50%
Head commit (1e7c6ab) 9565 (+64) 7325 (+57) 76.58% (+0.08%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#179) 95 92 96.84%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Copy link

trag-bot bot commented May 30, 2025

@trag-bot didn't find any issues in the code! ✅✨

Copy link

trag-bot bot commented May 30, 2025

Pull request summary

  • Added configuration for duplication detection in .codacy.yml, excluding test files.
  • Updated .codecov.yml to use a secret token for enhanced security.
  • Modified GitHub Actions workflow in .github/workflows/codecov.yml to output JUnit XML from pytest and upload test results to Codecov.
  • Refactored CSV export functionality in ams/core/matprocessor.py to utilize a new helper function get_export_path for path management.
  • Enhanced system2mpc function in ams/io/matpower.py to handle multiple PQ generators at the same bus, ensuring correct power summation.
  • Added new tests in tests/test_io.py to validate the conversion of AMS systems to MPC format with multiple PQ generators.
  • Created new test cases in tests/test_paths.py to verify the functionality of the get_export_path utility.
  • Updated documentation in docs/source/release-notes.rst to reflect recent changes and improvements.
  • Fixed minor bugs and improved logging in various modules for better traceability.
  • Adjusted example notebooks to reflect changes in output formats and ensure consistency with the latest code updates.

Copy link

trag-bot bot commented May 30, 2025

@trag-bot didn't find any issues in the code! ✅✨

Copy link

trag-bot bot commented May 30, 2025

Pull request summary

  • Added configuration for duplication detection in .codacy.yml, excluding test files.
  • Updated .codecov.yml to use a secret token for enhanced security.
  • Modified GitHub Actions workflow in .github/workflows/codecov.yml to output JUnit XML from pytest and upload test results to Codecov.
  • Refactored CSV export functionality in ams/core/matprocessor.py to utilize a new helper function get_export_path for path management.
  • Enhanced system2mpc function in ams/io/matpower.py to handle multiple PQ generators at the same bus, ensuring correct power summation.
  • Added new tests in tests/test_io.py to validate the conversion of AMS systems to MPC format with multiple PQ load.
  • Created a new utility function get_export_path in ams/utils/paths.py to streamline file path generation for exports.
  • Updated documentation in docs/source/release-notes.rst to reflect recent changes and improvements.
  • Fixed minor bugs and improved logging in various modules for better traceability.
  • Added unit tests in tests/test_paths.py to verify the functionality of the new get_export_path utility.

@jinningwang jinningwang merged commit 2166f43 into master May 30, 2025
36 of 37 checks passed
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