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

core: make ImplicitBuilder public #1034

Merged
merged 2 commits into from May 31, 2023
Merged

Conversation

superlopuh
Copy link
Member

From the discussion on #1017, I thought it might be better to make the ImplicitBuilder public in a separate PR.

@superlopuh superlopuh added the core xDSL core (ir, textual format, ...) label May 31, 2023
@superlopuh superlopuh self-assigned this May 31, 2023
@superlopuh superlopuh requested a review from webmiche as a code owner May 31, 2023 09:20
@codecov
Copy link

codecov bot commented May 31, 2023

Codecov Report

Patch coverage: 90.00% and project coverage change: -0.01 ⚠️

Comparison is base (f1f1282) 86.90% compared to head (9a730cd) 86.89%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1034      +/-   ##
==========================================
- Coverage   86.90%   86.89%   -0.01%     
==========================================
  Files         125      125              
  Lines       19317    19319       +2     
  Branches     2929     2929              
==========================================
+ Hits        16787    16788       +1     
- Misses       2028     2029       +1     
  Partials      502      502              
Impacted Files Coverage Δ
xdsl/builder.py 93.96% <90.00%> (-0.78%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@webmiche webmiche left a comment

Choose a reason for hiding this comment

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

I like it. Feels like we are actually starting to think about review standards and things that fit in a PR and ones that don't 👍 😉

@webmiche webmiche added the minor For minor PRs, easy and quick to review, quickly mergeable label May 31, 2023
Copy link
Collaborator

@math-fehr math-fehr left a comment

Choose a reason for hiding this comment

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

👍

@@ -114,6 +114,9 @@ def region(
else:
return Builder._region_args(input)

def implicit(self) -> ImplicitBuilder:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add here a reference to ImplicitBuilder as documentation?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm a bit confused, it's a command/control click away

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well yes, but at this point, especially for new people, what people see is just a function creating something else. They don't necessarily know how to use it, and having just a bit of documentation can help.
Just something like "Create an implicit builder that is used in a with region. See ImplicitBuilder" can really help people understanding what this is supposed to be. Otherwise, people might just skip over it?
What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Wouldn't your first instinct be to look at what the return type is? I doubt that many people will skip over it, although maybe I'm wrong. In VSCode you wouldn't even need to click on it, hovering over the type will bring up the docstring

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, yeah when you are looking at the operation.
But when you are looking at a use of implicit, you would like to know what it does (meaning, that it creates a new implicit context). Here, you would have to jump to the implicit definition to understand what it does, and then to jump to the ImplicitBuilder.
That's why I would say that a single sentence would still help, but if you think I'm too hard on that, we could skip it.

Copy link
Member Author

Choose a reason for hiding this comment

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

No I think you're right, but in some ways doccomments are a liability, in that there's no way to test that they don't become outdated as we change the code. I'd like to keep documentation as close as possible to the place where the code is defined, so that it's easier to update things as they evolve, and avoid misleading people. I think we can assume that the kind of people who read documentation can navigate to the definition of a class they are interested in. Especially since I don't expect that this function will be used explicitly. Now that I think about it, maybe I should just delete this function and use ImplicitBuilder(block) instead... I'll try it out.

Copy link
Member Author

Choose a reason for hiding this comment

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

I deleted this method in the other PR

@superlopuh superlopuh merged commit a3939d0 into main May 31, 2023
12 checks passed
@superlopuh superlopuh deleted the sasha/builder/implicit-public branch May 31, 2023 09:35
@superlopuh
Copy link
Member Author

Sorry @math-fehr was a bit trigger happy with the merge, lmk if there's documentation that you think is missing, I'm not exactly sure what you meant still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core xDSL core (ir, textual format, ...) minor For minor PRs, easy and quick to review, quickly mergeable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants