Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyTA & MemoryViz improvement discoveries #91

Open
leowrites opened this issue Oct 5, 2024 · 0 comments
Open

PyTA & MemoryViz improvement discoveries #91

leowrites opened this issue Oct 5, 2024 · 0 comments

Comments

@leowrites
Copy link
Collaborator

leowrites commented Oct 5, 2024

Improvements

SnapshotTracer

  • With SnapshotTracer, if there is a reassignment, the old value disappears, which does not match the notes in CSC110. This means across snapshots, it's possible for the id of a value to change, even though there was no reassignment. In the course notes, the list and its values still exist after reassignment of s
    Screenshot 2024-10-06 at 7 31 00 PM

Snapshot

  • If there is a variable x=1, 1 will be given its own primitive type box. If another variable y also get assigned y=1, both x and y will point to the same primitive value. For example, the code
x = [1, 2, 3] 
y = [1, 2, 3]
z = x

produced this:
Screenshot 2024-10-06 at 7 34 16 PM
However for y, each of 1, 2, 3 should have its own box instead of referring to the existing primitives.

Memory Model Layouts

  • There are two ways to organize the boxes in the output - manually inputting the x and y coordinates, or use automate and use blank boxes. An improvement could be to define rows and columns, similar to the css grid to make organizing the boxes easier.
  • It may make it easier to find variables if we group the variables with the frames they came from. Currently, the frames are put on top of each other which creates a lot of vertical space. The objects are put to the right of the frames, and they usually don't take as much vertical space as the frames. In this following example, func2 is placed at the very bottom, but its variables are all the way at the top making it difficult to find related variables.
    Screenshot 2024-10-06 at 7 42 52 PM

Errors

  • An error Error: Reduce of empty array with no initial value is thrown when an empty JSON [] is passed as a value
  • When a list type is used and the value is not a list, the error TypeError: element_ids.forEach is not a function will occur. Need to confirm if this is a behavior we chose not to handle because we assume users to provide valid objects.

Codebase

  • For DrawnEntity.type, we could use better documentation for the special types, like .frame or .blank. These types are mentioned in the doc and exist in the demo, but there is no dedicated place for all the special types.
  • In general, add types to function parameters for type hinting and more robust code. For example, there is a package for the styles tag, which we can use to replace AttributesStyle in styles.ts. Another good place for typing is the configuration parameter for draw. This would allow the users to see what options are supported as they are using it.
  • Due of the lack of types, I wasn't sure what values are allowed for the configuration parameter for draw. I also wasn't able to find documentations for the configuration object other than its usage in the demos. This would be fixed if the parameter is typed.
  • Arrays that defines if a type isimmutable, collections, or primitives are exported from styles.ts which appears to be containing style presets.

Misc

  • Not all presets in 05-presets.md have an example image
  • The documentation website linked in README.md and on the demo page points to 404.

Need to confirm these behaviors are intended

  • ids are allowed to be strings.
    Screenshot 2024-10-06 at 7 44 22 PM
  • The background of the boxes are transparent.
  • When using draw, there is no way to specify the output path like you could with the CLI.
  • It’s possible to have variables that points to ids that are non-existent.
  • The same Id is allowed to appear multiple times in the diagram.
@leowrites leowrites changed the title MemoryViz improvement discoveries PyTA & MemoryViz improvement discoveries Oct 7, 2024
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

No branches or pull requests

1 participant