microsoft / microsoft/CyberBattleSim

convert NamedTuples to @dataclass

Open
#38 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Jupyter Notebook
Stars
1.8k
Forks
286
Avg merge
4h 35m
Merged PRs (30d)
12

Description

Hi, I'm creating a frontend wrapper for this project and noticed that NamedTuple and @dataclasses are used almost interchangeably in model.py. I was wondering why that's the case and if it would be possible to just change all NamedTuples to @dataclasses. This would make the model more consistent. I tried changing it for a couple classes and didn't notice anything breaking.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading model.py and inventory every NamedTuple and @dataclass usage, noting how the frontend wrapper consumes these models. Check whether converting the remaining NamedTuples preserves the existing behavior, and consider the work done when model.py uses a consistent representation without breaking the wrapper.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.