Skip to content

Correct the type for Deploy.init#144

Open
rswarbrick wants to merge 1 commit intolowRISC:masterfrom
rswarbrick:deploy-init-type
Open

Correct the type for Deploy.init#144
rswarbrick wants to merge 1 commit intolowRISC:masterfrom
rswarbrick:deploy-init-type

Conversation

@rswarbrick
Copy link
Copy Markdown
Contributor

The code in the constructor actually depends on lots of fields that are only in SimCfg, but we aren't really type-safe yet, so only find this out at runtime (when we try to do something other than a simulation).

Correct the type safety at the site where we actually create the Deploy object.

The code in the constructor actually depends on lots of fields that
are only in SimCfg, but we aren't really type-safe yet, so only find
this out at runtime (when we try to do something other than a
simulation).

Correct the type safety at the site where we actually create the
Deploy object.

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
return pprint.pformat(self.__dict__) if log.isEnabledFor(log.VERBOSE) else self.full_name

def __init__(self, sim_cfg: "SimCfg") -> None:
def __init__(self, sim_cfg: "FlowCfg") -> None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, this is a useful fix. I wonder, would it not be a good idea to rename sim_cfg -> flow_cfg as well?

Copy link
Copy Markdown
Contributor

@AlexJones0 AlexJones0 left a comment

Choose a reason for hiding this comment

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

Also, as a nit on this PR (and all of the other PRs that you opened): I think the current preference is to use conventional commit names, because we have python-semantic-release setup to automatically parse these to generate changelogs and release notes.

I'm not sure how the tool would parse these, but it would be good to tag them as refactor: or fix: appropriately so the tool doesn't all think they're new features and bump the minor version for every merge.

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