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

[intro_supply_demand] Adding to supply and demand lecture #372

Merged
merged 10 commits into from
Feb 19, 2024

Conversation

jstac
Copy link
Contributor

@jstac jstac commented Feb 18, 2024

Adding introductory material to the start, for readers from computer science and other backgrounds.

Copy link

netlify bot commented Feb 18, 2024

Deploy Preview for taupe-gaufre-c4e660 ready!

Name Link
🔨 Latest commit bb680be
🔍 Latest deploy log https://app.netlify.com/sites/taupe-gaufre-c4e660/deploys/65d32194ba03d400080f1ffb
😎 Deploy Preview https://deploy-preview-372--taupe-gaufre-c4e660.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Feb 18, 2024

@github-actions github-actions bot temporarily deployed to pull request February 18, 2024 04:35 Inactive
@jstac
Copy link
Contributor Author

jstac commented Feb 18, 2024

Hey @mmcky , is this failing due to broken links? That seems to be the message in the log file...

@mmcky
Copy link
Contributor

mmcky commented Feb 18, 2024

Hey @mmcky , is this failing due to broken links? That seems to be the message in the log file...

That's right @jstac -- the linkchecker is failing with:

(        eigen_II: line  435) broken    https://math.stackexchange.com/questions/2433997/can-all-matrices-be-decomposed-as-product-of-right-and-left-eigenvector - 403 Client Error: Forbidden for url: https://math.stackexchange.com/questions/2433997/can-all-matrices-be-decomposed-as-product-of-right-and-left-eigenvector
(intro_supply_demand: line  332) broken    https://math.stackexchange.com/questions/275310/what-is-the-difference-between-linear-and-affine-function - 403 Client Error: Forbidden for url: https://math.stackexchange.com/questions/275310/what-is-the-difference-between-linear-and-affine-function
(markov_chains_II: line  619) broken    https://math.stackexchange.com/questions/3336616/how-to-prove-this-matrix-is-a-irreducible-matrix - 403 Client Error: Forbidden for url: https://math.stackexchange.com/questions/3336616/how-to-prove-this-matrix-is-a-irreducible-matrix
(         eigen_I: line 1274) broken    https://stackoverflow.com/questions/22867620/putting-arrowheads-on-vectors-in-a-3d-plot - 403 Client Error: Forbidden for url: https://stackoverflow.com/questions/22867620/putting-arrowheads-on-vectors-in-a-3d-plot

Looks like stackoverflow and stackexchange has blocked bot link requests with a 403 so I guess we need to add stackoverflow to the ignore pattern.

FYI - the linkchecker will only run once so if there are false positives any subsequent runs don't fail on any given PR.

@jstac
Copy link
Contributor Author

jstac commented Feb 18, 2024

Thanks @mmcky . I've pushed a trivial change to generate a build w/o the link checker.

@mmcky
Copy link
Contributor

mmcky commented Feb 18, 2024

Thanks @mmcky . I've pushed a trivial change to generate a build w/o the link checker.

No worries @jstac -- also they are separate workflows so if you take a look at the box at the bottom of the PR

Screenshot 2024-02-18 at 3 46 02 pm

you will see the Build HTML and Netlify have green ticks. But you still get a nasty X and an email from the linkchecker saying it has failed unfortunately. Link checkers are both great and frustrating. I mainly setup the run just once (on opening a PR) to save our sanity :-)

@github-actions github-actions bot temporarily deployed to pull request February 18, 2024 04:51 Inactive
@jstac
Copy link
Contributor Author

jstac commented Feb 18, 2024

To do:

  • Get feedback from @thomassargent30
  • Careful proofread, spell check
  • Unify the colors across the whole lecture

@jstac
Copy link
Contributor Author

jstac commented Feb 18, 2024

@mmcky Tom has given the green light on these changes.

Would you mind to proofread and then change the colors below so they are unified with the colors above (same colors for supply curve throughout, demand curve throughout, etc.)?

@jstac
Copy link
Contributor Author

jstac commented Feb 18, 2024

This PR aims to close #358 and #355

Remaining tasks:

  • Change the class to a NamedTuple and the methods to functions. Slightly change wording around the code to reflect this.
  • In the integrals, change dx to \mathrm{d} x.
  • Add a little explanation or some hints for scipy.optimize.minimize_scalar and scipy.optimize.newton --- perhaps just linking to our Python programming lecture on SciPy, which discusses both.
  • proofread, spell check
  • change the colors below https://intro.quantecon.org/intro_supply_demand.html#supply-and-demand so they are unified with the colors above (same colors for supply curve throughout, demand curve throughout)

@mmcky Would you mind to implement these changes?

@mmcky mmcky self-assigned this Feb 18, 2024
@mmcky mmcky added the improve label Feb 18, 2024
@github-actions github-actions bot temporarily deployed to pull request February 19, 2024 00:25 Inactive
@mmcky
Copy link
Contributor

mmcky commented Feb 19, 2024

I have started the following discussion https://github.com/orgs/QuantEcon/discussions/128 to run some ideas around how to select colours for plots and figures in a more "style" friendly and consistent way across lectures.

def inverse_supply(self, q):
return self.s_0 + self.s_1 * q
def create_market(d_0=1.0, d_1=0.6, s_0=0.1, s_1=0.4):
return Market(d_0=d_0, d_1=d_1, s_0=s_0, s_1=s_1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe add "The function below creates an instance of a Market namedtuple with default values."

```

Let's create an instance.
We can now define some functions that `create` and `operate` on these Market parameters.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm confused. Don't we already have the code in 670 above, in line 363?

Either way, I suggest dropping the back ticks, which should be reserved for code.

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry @jstac I prematurely pushed. Working on the final proof read now :-).

Copy link
Contributor

Choose a reason for hiding this comment

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

this duplication is no resolved after 5e2d75b. I had implemented the namedtuple in the exercise first and was propagating it to the text.

@github-actions github-actions bot temporarily deployed to pull request February 19, 2024 05:03 Inactive
@jstac
Copy link
Contributor Author

jstac commented Feb 19, 2024

Great work, thanks @mmcky.

Perhaps you could ask someone to embed the figures in numbered figure environments. It's not a big deal but it does make it easier to reference figures.

@github-actions github-actions bot temporarily deployed to pull request February 19, 2024 09:47 Inactive
@mmcky
Copy link
Contributor

mmcky commented Feb 19, 2024

thanks @jstac

Would you mind to add some color to the integration plot?

This is now back to blue for the area (default matplotlib style)

I guess the blue in https://65d2e116b996fdd433830db5--taupe-gaufre-c4e660.netlify.app/_images/588c1ba82d4c92f3f400cc7298cc50feb9a8c553f35be8cfa93ee948cc81b055.png should be made the same as the green in the inverse supply curve just below (since it's a discrete approximation).

Good catch. This is now green.

Perhaps you could ask someone to embed the figures in numbered figure environments. It's not a big deal but it does make it easier to reference figures.

All figures are now numbered with captions except those figures in the exercises. I didn't think they needed captions and/or references but let me know if you think they do.

👍

@mmcky mmcky changed the title Adding to supply and demand lecture [intro_supply_demand] Adding to supply and demand lecture Feb 19, 2024
@jstac
Copy link
Contributor Author

jstac commented Feb 19, 2024

Perfect, thanks @mmcky !!

I'll leave you to merge when ready (and please make it live).

@mmcky mmcky merged commit 0249ac8 into main Feb 19, 2024
6 checks passed
@mmcky mmcky deleted the update_sd_lecture branch February 19, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants