Skip to content

Conversation

@csmangum
Copy link
Contributor

@csmangum csmangum commented Oct 24, 2024

Related to #40

Add Tracker class and integrate it with KrebsCycle class to monitor simulation metrics.

  • Add Tracker class: Create Tracker class with methods start_tracking(), log_change(metric: str, value: float), report(), and reset(). Add attributes tracked_metrics and simulation_step. Implement EnergyTracker and CO2Tracker classes inheriting from Tracker.
  • Integrate Tracker with KrebsCycle: Import Tracker, EnergyTracker, and CO2Tracker classes. Initialize instances of EnergyTracker and CO2Tracker in the KrebsCycle class constructor. Call start_tracking() method of EnergyTracker and CO2Tracker in the run_cycle method. Call log_change() method of EnergyTracker and CO2Tracker in each step method. Call report() method of EnergyTracker and CO2Tracker at the end of the run_cycle method.
  • Add unit tests: Add unit tests for the Tracker class methods start_tracking(), log_change(metric: str, value: float), report(), and reset(). Add unit tests for the EnergyTracker and CO2Tracker classes.

For more details, open the Copilot Workspace session.

Related to #40

Add `Tracker` class and integrate it with `KrebsCycle` class to monitor simulation metrics.

* **Add `Tracker` class**: Create `Tracker` class with methods `start_tracking()`, `log_change(metric: str, value: float)`, `report()`, and `reset()`. Add attributes `tracked_metrics` and `simulation_step`. Implement `EnergyTracker` and `CO2Tracker` classes inheriting from `Tracker`.
* **Integrate `Tracker` with `KrebsCycle`**: Import `Tracker`, `EnergyTracker`, and `CO2Tracker` classes. Initialize instances of `EnergyTracker` and `CO2Tracker` in the `KrebsCycle` class constructor. Call `start_tracking()` method of `EnergyTracker` and `CO2Tracker` in the `run_cycle` method. Call `log_change()` method of `EnergyTracker` and `CO2Tracker` in each step method. Call `report()` method of `EnergyTracker` and `CO2Tracker` at the end of the `run_cycle` method.
* **Add unit tests**: Add unit tests for the `Tracker` class methods `start_tracking()`, `log_change(metric: str, value: float)`, `report()`, and `reset()`. Add unit tests for the `EnergyTracker` and `CO2Tracker` classes.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Dooders/Pyology/issues/40?shareId=XXXX-XXXX-XXXX-XXXX).
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