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

Cleaning up the implementation code in Implementation/simulate.py #3

Open
jcal13 opened this issue Jun 19, 2024 · 0 comments
Open

Cleaning up the implementation code in Implementation/simulate.py #3

jcal13 opened this issue Jun 19, 2024 · 0 comments

Comments

@jcal13
Copy link
Collaborator

jcal13 commented Jun 19, 2024

Short list of things to be cleaned up in this file. As discussed previously, keeping in some of these things and addressing them in the readme would also be good... perhaps having two (or more) versions of the file could be worth considering, like a "starter" file and a "solution" file or similar.

  • updating the docstring formatting to be fully consistent with CSC148 (rough example below for the Particle class):
class Particle:
    """
    An abstract class representing a particle.

    Attributes:
    - id: unique ID
    - x: x-coordinate
    - y: y-coordinate
    - radius: radius
    - colour: colour
    - shape: shape

    Representation Invariants:
    - self.x >= 0
    - self.y >= 0
    - self.radius > 0
    - self.shape in {'circle', 'square'}

    """
    id: int
    x: float
    y: float
    radius: int
    colour: tuple[int, int, int]
    shape: str
  • running python TA and fixing all style issues, such as ones mentioned below:
    • adding type annotations to all functions and methods; for tuple, make sure to specify the types the tuple contains (e.g., tuple[float, float] for coordinates... or using int if in units of pixels).

    • adding docstrings to all functions and methods, with docstring examples as appropriate.

    • naming conventions with pothole case used for method names and CamelCase for class names.

    • 80 character line length max.

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