Skip to content

feat:Add configuration management to dashboard and test infrastructure prototype#25

Merged
bassosimone merged 2 commits intom-lab:mainfrom
zarsl:feat/dashboardconfigurations
Nov 24, 2025
Merged

feat:Add configuration management to dashboard and test infrastructure prototype#25
bassosimone merged 2 commits intom-lab:mainfrom
zarsl:feat/dashboardconfigurations

Conversation

@zarsl
Copy link
Collaborator

@zarsl zarsl commented Nov 23, 2025

This update performs the following:

- Updated code management: Clearly delineates constants, utility functions, UI rendering functions etc. for cleaner code management
image

- Creates a dataclass for state management: Instead of repeatedly modifying session state, I used a dataclass to contain the various session state values
image

- Created test infrastructure: Unit tests added for the state management and general functionality of the prototype, followed pattern in /library.

- Enhanced manual entry function: Created a simple and advanced version where user can modify measurements attributed to each dataset(Cloudflare etc.). Previously manually entered values were being entered for all datasets. Now the user can select between attributing to all or to select datasets.
image
image

- Created modify configurations section: This section allows the user to define thresholds for each use case, define weights given to each network requirement, adjust use case weights and adjust dataset weights.
image

- Modified View calculation details section
Removed the Manual Entry portion and created a section that displays user entered configurations that are sent to the calculate functions.
image

@bassosimone bassosimone changed the title feat:Add configuration management to dashboard and test infrastructur… feat:Add configuration management to dashboard and test infrastructure prototype Nov 23, 2025
Copy link
Collaborator

@bassosimone bassosimone left a comment

Choose a reason for hiding this comment

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

I did a lightweight review and I like what I see in terms of code organization and structure. I like that you added tests, especially for conversion functions.

I am going to merge this and deploy, so it's easier for us to test what is it doing.

Thanks!


def test_identify_download(self):
"""Test download requirement identification."""
assert identify_requirement_type("download_speed") == RequirementType.DOWNLOAD
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like that you introduced a RequirementType. Neat!

"use cases": {
"video_streaming": {
"w": 1.0,
"network requirements": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not a comment about the current pull request, rather a reminder for me for later. I think we should try to avoid spaces in JSON documents, because it's more idiomatic to have underscores and there are benefits in terms of JavaScript DX as well. I'll most likely circle around to this next time I notice/remember: I already cleaned up part of the JSONs but missed this part.

Comment on lines +228 to +237
def test_negative_packet_loss_display(self):
"""Test handling of negative values."""
# This should work but produce negative percentage
result = convert_packet_loss_for_display(-0.1)
assert result == -10.0

def test_large_packet_loss_values(self):
"""Test handling of values > 100%."""
result = convert_packet_loss_for_display(2.0)
assert result == 200.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment is not a blocker. I'd like to know the rationale though. My initial instinct here would have been to either normalize to the boundary (0-100%) or to throw (signal a bug). Can you elaborate on why you chose this strategy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a fair callout - typically I have a standard checklist I use for making unit tests so I was just going down the line but it makes more sense to bound it to 0-100, I will update on my next PR

else: # Datasets
font_sizes.append(DATASET_FONT_SIZE)

fig = go.Figure(
Copy link
Collaborator

Choose a reason for hiding this comment

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

"go figure" LOL this reads funny



if __name__ == "__main__":
main()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment is not a blocker. This file starts being quite large. It may make sense to split the functions it uses thematically (unless this creates too much indirection) in the interest of not creating too large context windows for AI. We should maybe consider this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes definitely, I'm already finding I am replicating a lot of code unnecessarily in the Map portion so I am reorganizing to shorten the file and abstract away some of the functions so it can be repurposed more easily.

@bassosimone bassosimone merged commit 6cf21c8 into m-lab:main Nov 24, 2025
4 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.

2 participants