add enums to support gas public offer - #63
Conversation
There was a problem hiding this comment.
Pull request overview
Adds new Market and Status enum members in Artesian.GMEPublicOffers intended to support GAS public offer querying.
Changes:
- Extend
Statusenum withDIS. - Extend
Marketenum withGMP_ASTA,GMP_Cont,MI_Cont,MGS.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Artesian/GMEPublicOffers/_Enum/Status.py | Adds DIS status enum value. |
| src/Artesian/GMEPublicOffers/_Enum/Market.py | Adds new GAS-related market enum values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| GMP_ASTA = 230 | ||
| GMP_Cont = 234 | ||
| MI_Cont = 235 | ||
| MGS = 240 |
| COM = 7 | ||
| PCOM = 8 | ||
| PREJ = 9 | ||
| DIS = 10 |
There was a problem hiding this comment.
Fixed in commit 8fc100d by adding Status.DIS: "DIS" to GMEPublicOfferQuery.__getStatus().
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
src/Artesian/GMEPublicOffers/_Enum/Market.py:31
- New Market enum members were added (GMP_ASTA/GMP_Cont/MI_Cont/MGS), but GMEPublicOfferQuery.__getMarket() does not map them to API strings. Passing any of these values into queries will currently raise "Not supported Market" and the feature described in the PR won't work end-to-end.
GMP_ASTA = 230
GMP_Cont = 234
MI_Cont = 235
MGS = 240
src/Artesian/GMEPublicOffers/GMEPublicOfferQuery.py:375
- __getStatus() still doesn't handle Status.PREJ even though it exists in the Status enum. Using Status.PREJ will currently raise "Not supported Status"; since this PR is extending status support, the switcher should be kept in sync with the enum.
Status.ACC: "ACC",
Status.INC: "INC",
Status.REJ: "REJ",
Status.REP: "REP",
Status.REV: "REV",
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
src/Artesian/GMEPublicOffers/GMEPublicOfferQuery.py:346
__getMarket()contains a duplicatedMarket.MRRkey in the switcher dict (it appears twice). The later duplicate is dead code and makes it harder to see whether a distinct market mapping is missing.
Market.MIA2: "MIA2",
Market.MIA3: "MIA3",
Market.MRR: "MRR",
Market.AFRR: "AFRR",
Market.GMP_ASTA: "GMP_ASTA",
src/Artesian/GMEPublicOffers/GMEPublicOfferQuery.py:350
- New market codes were added (e.g.,
GMP_ASTA,GMP_Cont,MI_Cont,MGS), but the existing request-building tests only assert a few oldermarketvalues. Add/extend pytest/unittest coverage (e.g., intests/TestGMEPO.py) to assert these new market values are serialized into themarketquery parameter correctly.
Market.GMP_ASTA: "GMP_ASTA",
Market.GMP_Cont: "GMP_Cont",
Market.MI_Cont: "MI_Cont",
Market.MGS: "MGS",
src/Artesian/GMEPublicOffers/GMEPublicOfferQuery.py:380
Status.DISis now supported in__getStatus(), but the current tests only exerciseStatus.ACC(and don’t explicitly assert the status segment/value for DIS). Add a test that builds a query withStatus.DISand asserts the generated request uses the expected DIS code.
Status.SUB: "SUB",
Status.COM: "COM",
Status.PCOM: "PCOM",
Status.DIS: "DIS",
}
Add market and status enums to support GAS public offer