-
Notifications
You must be signed in to change notification settings - Fork 227
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
Large scale refactoring #251
base: dev
Are you sure you want to change the base?
Conversation
b3fd091
to
b45d0ae
Compare
Dear Daniel, I just wanted to drop you a line that I appreciate your efforts on this task very much. With kind regards, |
I have resumed work on the refactoring after a longer period of inactivity. and I would like to propose a course of action to get the bulk of this code integrated into
Thank you for your patience and understanding. |
d69e3ba
to
417c842
Compare
@formatc1702 wrote:
I'd be happy to do that, but the installation failes as described in #287.
I agree this sounds like a wise decision.
OK |
One thing I still want to add is updated documentation / changelog. And I might rearrange some code blocks to make more sense.. but no further actual development. |
I've not yet had time to test all new code, but I list here a few issues I've noticed so far:
|
The idea is that I agree that testing |
I like it! @kvid: I don't know if it's in the documentation yet, but the recommended way to "install" that entrypoint, while in development/sandbox mode, is to invoke This will run the installation process in development mode (what was Edit: I see that [1] may be a bit thin. Let me replicate a full sandbox installation example here if you don't mind: git clone https://github.com/formatc1702/WireViz --branch=refactor/big-refactor
cd WireViz
python3 -m venv .venv
source .venv/bin/activate
pip install --editable=.
wireviz --version
[1] https://github.com/formatc1702/WireViz/blob/master/docs/README.md#installing-the-development-version |
I do not want to be to anything but is there a time frame of when this is merged, since this is kind of putting new features at hold😁🤦♂️ |
When v0.4.1 is released, then those fixes need to be merged with this PR into Such fixes are normally a number of small changes only, but when the same part of the code is also refactored in this PR, then we need to rework each of those fixes. This PR doesn't block all new features, but most HTML generating code is refactored here, so other major code changes in that part of the code based on the latest release (before this PR) will need rework before a merge-in after this PR. |
Well, since it renames "Dataclasses.py" and "Harnesses.py" everything that needs to be implemented in either of those two has to be redone. |
If you have time for rework now, but maybe not later, then I suggest you consider creating two new PRs based on the This way it should be much easier to later rebase your new feature branches on top the new Be aware that it's not safe to base your new PRs on the #251 feature branch, because when that branch is deleted after the #251 merge-in, all PRs based on a deleted branch will be automatically closed by github, and it's not easy to reopen such automatically closed PRs.
I don't find you annoying! 😄 Maybe you mean "annoyed"? |
Thx |
@tobiasfalk wrote:
That seems to be the result of creating In that case, I don't know if a later rebase of I don't know the remote names of your local repo, but you can list them with These are the commands that represent what I suggested in my previous comment ( git branch --no-track new_feature1 remotes/{official remote}/refactor/big-refactor
git push -u {personal fork} new_feature1 Update: I also strongly recommend not adding changes of generated files into feature branches. Following that advice will reduce the number of conflicts when rebasing (or merging). |
I fully agree and I feel bad that it has taken so long; it's a big change that I started on my own, but due to limited capacity I have not been able to complete it in a satisfactory way. I am extremely thankful for all input recently, and the big help in developing, reviewing and integrating fixes. Currently, I can offer little more than some light guidance and clicking the final "merge" on PRs, or publishing a release to PyPI, but not much coding. #365 is almost ready, and merging this refeactoring should be top prio afterwards. Again, I will appreciate the support here (especially from contributors more versed in resolving the ugly merge conflicts that may occur) as well as in the subsequent bugfixing and integrating all fixes made to the old codebase in the meantime (from v0.4 to v0.4.1). So, big ❤️ to the active contributor community. @kvid if you can, please have a look at our private chat. Thx! |
Use version from v0.4.1 master branch. Fix missing link to v0.4.1 (L8) so it's not forgotten.
#365 is merged, I would suggest we now merge this one and create a Task List to make working on this easier. |
I totally agree, and I've started some testing, but I'm quite busy at my paid work this month. Up to now, I've found a few bugs, but as they also seem to be present in v0.4.1, I plan to describe them in a new issue to be fixed later. If you have the time and the enery, you are welcome to do your own review in parallel, maybe describe what you tested, and suggest alternatives. My idea is to bring in the v0.4.1 changes stepwise into |
I will look in to it, but I do not relay have much experience in code testing and reviewing.
Sounds good, as mentioned, I would start with a simple List of what needs to be transplanted/reimplemented. Two of the big points that I would put on this Task List, would be #406 and #387, since they would make communication with the users easier and take the work off the developers, yes even though they practically have nothing to do with this PR. |
GitHub has something called Projects (here the FreeCAD Git for example: https://github.com/orgs/FreeCAD/projects) this would be a good solution to group the relevant Issues and so. |
opend a review for those two |
rows.append(Tr(Td(table_below, colspan=len(cells_above)))) | ||
|
||
rows.append(Tr(Td(" "))) # spacer row on bottom | ||
tbl = Table(rows, border=0, cellborder=0, cellspacing=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# check if it's an actual wire and not a shield | ||
color = f"#000000:{connection.via.color.html_padded}:#000000" | ||
else: # it's a shield connection | ||
color = "#000000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just ran the examples and looked over it and found that with tutorial one the wires are not drawn correctly:
this does not happen when a color is defined:
Can easly be fixed with color = "#000000:#FFFFFF:#000000"
in line 402 of wv_graphviz.py and
def gv_wire_cell(wire: Union[WireClass, ShieldClass], colspan: int) -> Td:
if wire.color:
color_list = ["#000000"] + wire.color.html_padded_list + ["#000000"]
else:
color_list = ["#000000","#FFFFFF","#000000"]
wire_inner_rows = []
for j, bgcolor in enumerate(color_list[::-1]):
wire_inner_cell_attribs = {
"bgcolor": bgcolor if bgcolor != "" and bgcolor != "#000000" else "#000000",
starting at line 366
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Back in the day, drawing wires as thin when they don't have an explicit color assigned, was intentional, to distinguish an "uncolored" wire from a white or black one. For example, shields are also drawin in this style, since they don't have a color per se.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, didn't know that.
if wire.color: | ||
color_list = ["#000000"] + wire.color.html_padded_list + ["#000000"] | ||
else: | ||
color_list = ["#000000"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
color_list = ["#000000","#FFFFFF","#000000"], see line 402
@kvid and @formatc1702, how does it stand with merging this and creating a todo list of things from 0.4.1 that need to be reimplemented? |
This is a project wide refactoring effort.
I have decided to address it as one large chunk because the fundamental structure of the code needs to be rebuilt at once for this to work.
Goals:
Issues being addressed/solved:
A better description will follow once the code is presentable.
I am sharing the work in progress for transparency's sake.