-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add the capacity p-median example to the notebook #387
Conversation
Great work, @rongboxu! Let's discuss this in today's meetings. |
notebooks/p-median.ipynb
Outdated
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.
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 think your added section to the notebook looks great. Can you update according to the issue and PR for predefined facilities above?
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.
@rongboxu Add the following text above cell 49:
However, in many real world applications there may already be existing facility locations with the goal being to add one or more new facilities. Here we will define facilites
$y_0$ and$y_1$ as already existing (they must be present in the model solution). This will lead to a sub-optimal solution.Important: The facilities in
"predefined_loc"
are a binary array where1
means the associated location must appear in the solution.
See an example in the current version of the pmedian
notebook on main
above cell 24.
CI failures are not related to this PR – see #386 |
change the name of k to k_array and add the tests for specific errors
@rongboxu I think all substantive suggestions and comments have been addressed for the inclusion of |
Thank you for checking and reviewing the code! I will soon deal with the conflict in that ipynb and update it! Thank you again for providing the link to that comment. |
add the intro about predefined facilities above cell 49, sorry for only adding it above cell 24 in the previous commit
Hi James! I have added the corresponding part to the p-median.ipynb. However, it seems it still has conflicts? |
Yeah, conflicts in notebooks can be tricky... As another step, how about trying to clear all of the notebook's output before saving and then commit and push up again? Let's see if that does the trick. If it does not, we may have to actually open the |
Hi James! I try to look for the conflict markers, but I can't find any: I am not sure if these changes cause the conflict. |
Aycaramba, this merge conflict is getting tedious. We'll leave this PR open for now until Levi, Germano, or I can figure out what the heck is going on here. |
@jGaboardi conflicts on notebooks are cumbersome. So, I rebased the branch and, as expected, it resolved all the merge conflicts, by the way, there are 13 conflicts. You can see there are no conflicts on the rebased branch. However, I have no permission to make all these changes in @rongboxu repo. |
@@ -4,6 +4,8 @@ | |||
import numpy as np | |||
import pulp | |||
from geopandas import GeoDataFrame | |||
from pointpats.geometry import build_best_tree |
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.
Is it added to dependencies or I missed something? It is not installing when using this branch.
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.
Yes, I noticed this as well when try to run the notebook locally. @rongboxu pointpats
needs to be added to:
- the
.ci/
environments pyproject.tml
environment.yaml
@gegen07 Hi Germano! Thank you for making the rebased branch!! It is very very helpful! It doesn't have conflicts now. I wonder if I should rebase |
I think you could rebase this branch, but be careful rebasing it because it is a hard change in the history commits. I recommend using a diff tool as Levi commented on the last meeting or a git GUI client as GitHub Desktop to manage the conflicts. To avoid future problems with rebase, you should copy the files of your PR to another location to secure your summer work. |
I just created a new branch, and I solved three conflicts, now there are no conflicts on the new branch. |
That's great! Nice job! @jGaboardi @ljwolf agree? |
That works for me in the spirit of getting this done. |
Fine with that! |
#381
Hi! I want to pull the request of adding the capacity p-median example. I know I need to create a new forked repository later, just want to share the updated version so that I can get some advice!
Also, I noticed this pull request also contains my previous commit of adding references, I am confused of it because I remembered I have pulled it last week. If there is nothing wrong with this pull request, please do let me know and I will modify it!
Also, it says the diff on notebooks is too large to show. I suppose it's because I add the formulation, and made it longer.