Skip to content

Dev report#1

Open
ZhiruiLiang wants to merge 43 commits intomasterfrom
dev_report
Open

Dev report#1
ZhiruiLiang wants to merge 43 commits intomasterfrom
dev_report

Conversation

@ZhiruiLiang
Copy link
Copy Markdown
Collaborator

Include all the latest example scripts and results for report writing.

jaywonchung and others added 7 commits March 4, 2026 21:55
…Add functions to sweep ofo parameters, sweep DC locations, find DC hosting capacity, and optimize PV locations and capacities. Add IEEE 13, 34, 123 test feeders and example scripts. Include simulation outputs for IEEE 13, 34, 123 under multiple scenarios.
…Add functions to sweep ofo parameters, sweep DC locations, find DC hosting capacity, and optimize PV locations and capacities. Add IEEE 13, 34, 123 test feeders and example scripts. Include simulation outputs for IEEE 13, 34, 123 under multiple scenarios.
@jaywonchung
Copy link
Copy Markdown
Member

Please remove all output files that can be generated from running the examples. Data files do not belong in the code repository except when it's necessary for examples to run.

@jaywonchung
Copy link
Copy Markdown
Member

jaywonchung commented Mar 18, 2026

Also, please update code so that formatting, code checking, and testing pass. You can run them with bash scripts/lint.sh and pytest.

In general, I would back up a copy of the dir elsewhere so that you don't lose any files, and then ask claude code to clean up the branch so that it's suitable to post a PR.

Copy link
Copy Markdown
Member

@jaywonchung jaywonchung left a comment

Choose a reason for hiding this comment

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

Thank you for your work. This PR will mark a substantial advancement in what OpenG2G an do!

There are many structural issues -- please take your time to address them, and please let me know if anything is unclear.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a general comment/question about all OpenDSS case files in data/grid.

  1. data/grid was newly created, and examples/ieee13 was moved into it. However, I thought what used to be in examples/ieee13 were already customized by you and is no longer the same as what people would expect as the standard IEEE13 bus specification. That's why I put it under examples (to indicate that its specific to the baselines & OFO examples), not data (which lacks context & connection to our customization). What is the nature of these files? What do you think is the right place for this so that users are not misled?
  2. All file extensions should be .dss. Currently, it's a mixture of .dss and .DSS.
  3. IEEE13 has a CSV file (IEEE13Node_BusXY.csv) whereas the other two do not. Also, file names are all inconsistent, except for IEEELineCodes.dss. Is it possible to make things consistent? Unless, if this is how each case is shipped officially, or each case is quite different and making file organization consistent is actually impossible/harmful for usablity.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. I think you'll need to update _zensical.toml to include these example guides as a new section -- basically "Getting Started," "Guide," "Examples," and "API Reference" in order.
  2. Please remove the number prefix in the beginning of each example description markdown file. These numbers will be shown in the documentation website's URL and signals that there is an ordering of examples, but in fact, I don't think the examples have any particularly natural ordering.
  3. Please preview the documentation on your browser after running bash scripts/docs.sh serve and see if everything is rendered properly (e.g., no Markdown issues, links are all working).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this should be removed for now. We never tested it.

)
```

#### Inference Ramps
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think InferenceRamp is complicated enough to require a dedicated section in the docs. Same as now TrainingRun, TapPosition, etc. are not separately explained -- the API reference is likely sufficient. In general, we want to control the length of the guides in docs, because the longer it is, the less likely people will actually read it. Please delete this section.


- **`target`**: Fraction of initial servers to activate. `0.5` = half the servers; `1.0` = all servers (default); `1.5` = 50% more servers than the initial `initial_num_replicas`.
- **`model`**: When set, the ramp applies only to that model. When `None` (default), it applies to all models in the datacenter.
- **Scale-up** (target > 1.0): The datacenter pre-allocates extra servers at construction time based on the peak target in the schedule. At `t=0`, only the initial server count is active; the extra servers activate when the fraction exceeds 1.0.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was reading this an I think this API is weird. 1.0 (meaning 100%) should be a fixed ceiling. I don't think we want a constantly moving ceiling. For that, I think InferenceRamp(target=0.5).at(t=0) (with composition with |) is the right API. This way, we're specifying (time, target load) points across the whole timeline and we don't have to do this dynamic ceiling adjustment at all. Please refactor InferenceRamp.

Attributes:
dc_states: Every datacenter state produced by the datacenter.
dc_states: Every datacenter state produced by the datacenter (flat list, all sites).
dc_states_by_site: Per-site datacenter states (multi-DC mode).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Multiple DC should be a generalization of the original single DC. That is, single DC mode should be programmatically equivalent to multiple DC mode, except that there is only one DC site. Not touching the original single DC code and data path and slapping on multi-DC code and data on top of it is poor design.

Comment on lines +448 to +466
# For 3-phase regulators without explicit phase suffix,
# try to infer phase from the regcontrol name (e.g. creg1a -> A=1)
if phase not in (1, 2, 3):
name_lower = rc_name.lower()
if name_lower.endswith("a"):
phase = 1
elif name_lower.endswith("b"):
phase = 2
elif name_lower.endswith("c"):
phase = 3
elif n_phases == 3:
# 3-phase ganged regulator — assign to phase 1 as primary
phase = 1
logger.info(
"RegControl '%s' is 3-phase (buses=%s); treating as phase A.",
rc_name,
bus_names,
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Matching based on arbitrary string name patterns is highly error prone. Please make it type safe by generalizing the original pattern of having fields a, b, and c.

Comment on lines 44 to +47
a: float | None = None
b: float | None = None
c: float | None = None
regulators: dict[str, float] = field(default_factory=dict)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same complaint. Generalizing single -> multi should be a type-safe structural shift, not spraying escape hatch dicts on top of existing APIs that were built assuming single.

Comment on lines +69 to +74
Supports both single-DC (legacy) and multi-DC modes:

- **Single-DC**: Pass ``dc_bus``, ``dc_bus_kv``, ``connection_type``.
- **Multi-DC**: Pass ``dc_loads`` dict mapping site IDs to
:class:`DCLoadSpec`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ditto.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Many changes were made to the offline datacenter. Please review feature parity between the offline and online datacenters. For instance,

  • Did some new feature get introduced in offline datacenter but it's not handled by the online datacenter although it can be handled?
  • Did some configuration class change for a feature to be introduced in the offline datacenter, but the online datacenter silently ignores that configuration or even worse, error out?
  • The offlien and online datacenters used to share a lot of behavior between each other by sharing a lot of code paths. Did any assumptions based on shared codebase and behavior change only in offline and not updated in online?

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