Giter Club home page Giter Club logo

lecture-python-programming.myst's People

Contributors

aakashgfude avatar drdrij avatar hengchengzhang avatar horace510 avatar humphreyyang avatar jstac avatar mmcky avatar orectique avatar quincyhill avatar shlff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lecture-python-programming.myst's Issues

Migration Strategy -- Switching from lecture-python-programming

Once we are happy with the final output of this repository. We will need to:

Hosting and Deployment:

  • final migration of lecture-python-programming and freeze old repository.
  • merge in manual adjustments tagged as PRs
  • setup github pages for hosting this website
  • update our AWS https settings to point to github pages rather than an s3 bucket. (to go live)
  • work through CI workflows for simple updates to the live gh-pages branch.

Cleanup:

  • rename lecture-python-programming -> lecture-python-programming.rst (as a reference)
  • rename lecture-python-programming.myst -> lecture-python-programming (new source repo)
  • reconfigure gh-pages for new repo location

[Pandas]Footnotes link does not work

Hi @mmcky ,

The link in footnotes does not work in the end of Pandas lecture.
[Website]
Screen Shot 2020-09-23 at 9 12 37 pm
[netlify.app]
Screen Shot 2020-09-23 at 9 12 57 pm

In rst,

.. [#mung] Wikipedia defines munging as cleaning data from one raw form into a structured, purged one.

In md, link disappeared

Wikipedia defines munging as cleaning data from one raw form into a structured, purged one.

Referring to URL of lectures does not work

Hi @mmcky ,

In lectures, it often refers to other lectures and codes written in own lecture. However, this does not work in all lectures in myst.
(referring to Wikipedia or other website works ok)

For example:
in An introductory Example, it refers to Numpy. So, Numpy should be written blue like below in current website
Screen Shot 2020-09-14 at 9 52 37 pm

however, in netlify.app,
Screen Shot 2020-09-14 at 9 53 06 pm

In rst file:

The first line imports :doc:`NumPy <numpy>`, a favorite Python package for tasks like

But in Myst: <numpy> is dropped.

The first line imports NumPy, a favorite Python package for tasks like

[IPYNB_vs_HTML]_missing_contents_in_HTML(website)_for_each_lecture

Morning @mmcky and @AakashGfude ,

I noticed that there are contents for each lecture in the IPYNB files, which, however, are missing in the website/HTML files. For example, for lecture about_py, please see

  • IPYNB file, for which there are simply contents,
  • HTML file, which shows no contents for this lecture.

You can also see it from the following screenshot, where I labelled the contents with red lines:
Screen Shot 2020-12-07 at 7 45 10 am

Do you think it is a good idea to add contents, consistent with those in the IPYNB files, to the website/HTML files?

I find there are detailed contents for the new lecture series continuous-time Markov Chain, e.g., please see one of their lectures, memoryless, its contents are on the top right-hand side and will not disappear as we scroll down, which looks really cool!

Please look at this:
Screen Shot 2020-12-07 at 7 48 41 am

Do you think it is a good idea to make the contents specific to each lecture like what we have in lectures continuous-time Markov Chain?

[functions] Extra markup in List Objects

There is some extra > markup in list objects

generated md:

We will break this program into two parts:

1. A user-defined function that generates a list of random variables.
2. The main part of the program that
    1. > calls this function to get dat
    2. > plots the dat

source rst:

We will break this program into two parts:

#. A user-defined function that generates a list of random variables.

#. The main part of the program that

    #. calls this function to get data

    #. plots the data

Referring to equation does not work

Hi @mmcky ,

Referring to equations by allocated number does not work.
For example:
In website, Equation (1) is referred by the sentence " A steady state of the model is a k that solves (1) when kt+1=kt=k."
Screen Shot 2020-09-14 at 10 31 18 pm

However, in netlify.app, the sentence become " A steady state of the model is a π‘˜ that solves solow_lom when π‘˜π‘‘+1=π‘˜π‘‘=π‘˜."
It does not refer to equation by (1).
Screen Shot 2020-09-14 at 10 33 00 pm

In rst,

A **steady state** of the model is a :math:`k` that solves :eq:`solow_lom` when :math:`k_{t+1} = k_t = k`.

In myst, :eq: is dropped.

A **steady state** of the model is a $k$ that solves `solow_lom` when $k_{t+1} = k_t = k$.

numba jitclass warning

Hi @mmcky ,
In this lecture,
numba jitclass warning occurs. I think this issue happened in main web site lecture before...so I'm not sure this occurs because of this converting process.

Screen Shot 2020-09-24 at 2 30 08 pm

[IPYNB_vs_HTML]_numbering_for_lists_in_normal_lecture_contexts

Morning @mmcky and @AakashGfude ,

I find another issue that the numbering for some lists in normal lecture contexts can be problematic:

  • in source files, we just number some lists with 1. ...., 1. ..., 1. ..., etc.
  • but when they are converted into IPYNB and HTML files, they look differently: IPYNB (still 1. ...., 1. ..., 1. ..., etc.) vs HTML (1. ...., 2. ..., 3. ..., etc.)

For example, please see the lecture getting_started here:
Screen Shot 2020-12-07 at 8 34 00 am

I also notice this issue in some other lectures in basic and advanced lectures.

Do you think it is a better idea to modify the source files directly or do something in the converting job?

only:: is ignored

Hi @mmcky ,
Here, the sentence "Let’s look at an example that reads data from the CSV file pandas/data/test_pwt.csv that can be downloaded here." is shown twice in netlify.app.
Please see the last sentence in each screenshot below.
[Website]
Screen Shot 2020-09-23 at 9 00 02 pm
[Netlify.app]
Screen Shot 2020-09-23 at 9 01 21 pm

This issue occurs because only:: is ignored in netlify.app as follows.
in rst,

.. only:: html

    Let's look at an example that reads data from the CSV file ``pandas/data/test_pwt.csv`` that can be downloaded
    :download:`here <_static/lecture_specific/pandas/data/test_pwt.csv>`.

.. only:: latex

    Let's look at an example that reads data from the CSV file ``pandas/data/test_pwt.csv`` and can be downloaded
    `here <https://lectures.quantecon.org/_downloads/pandas/data/test_pwt.csv>`__.

In md,

Let's look at an example that reads data from the CSV file `pandas/data/test_pwt.csv` that can be downloaded
<a href=_static/lecture_specific/pandas/data/test_pwt.csv download>here</a>.

Let's look at an example that reads data from the CSV file `pandas/data/test_pwt.csv` and can be downloaded
[here](https://lectures.quantecon.org/_downloads/pandas/data/test_pwt.csv).

Use of raw html nodes causing an issue when using `jupyter-book` due to thebe config

@AakashGfude we have these raw html in our source markdown files. I am looking to get rid of them in favour of a pure md/myst solution due to thebe config getting added by jupyter-book automatically making sphinx-tojupyter acceptance of raw html nodes problematic.

```{raw} html
<div id="qe-notebook-header" align="right" style="text-align:right;">
        <a href="https://quantecon.org/" title="quantecon.org">
                <img style="width:250px;display:inline;" width="250px" src="https://assets.quantecon.org/img/qe-menubar-logo.svg" alt="QuantEcon">
        </a>
</div>
```

Does this have any affect on our html. It doesn't seem to -- it looks like it is just some html that is used in the download notebooks as a quantecon logo header? Is that right?

[IPYNB_vs_HTML]_wrong_tag/numbering_in_math_expressions_of_IPYNB_files

Hi @mmcky and @AakashGfude , good morning!

After comparing IPYNB and HTML files for all programming lectures, I noticed an important issue in the tags or numbering in math expressions of jupyter notebooks:

  • the numbering or tags for math expressions or equations in IPYNB files is different from those in HTML files,
  • when we cited those equations in both versions, the citation formats are the same.

For example, let's consider the lecture python_oop and look at the same equation, equation (1) in the ipynb (you need to view it in Anaconda or VS code)and equation (7.1) in the HTML:

  • In the following contexts of that equation, we cited the equation 3 times but using the tag/numbering the same as that in our website/HTML file (i.e., (7.1)).

You can also see this issue clearly from the following screenshot, where I labelled the equation tags with red lines.

Screen Shot 2020-12-06 at 11 11 46 am

Look forward to your comments.

Other issues I noticed are coming soon.

[jupyter-book] Specify pages that aren't in the TOC listing but are compiled

We currently use a few pages 404.md, status.md ... that are built by sphinx but shouldn't be part of the _toc.yml. This is an issue as it doesn't appear to be possible with jupyter-book at the moment.

I think:

404 -> theme supported
status -> unsupported for now but will be added by a status/stats directive as a page.
troubleshooting -> List it at the end of a the Book (for now) and implement a hidden from toc tag
search -> theme supported (or reserved for sphinx use)

thebe button not work

This is a good theme, is there a way to add a thebe button in the place below so that the code can be executed on the page

I tried setting thebe:true, but it didn't work

[pandas] Image too small -- fix with glue

from @jstac

The figure below "Complete the program to show summary statistics and plot the result as a time series graph like this one:" is also the wrong size. But rather than fix it, I suggest use of the glue functionality instead -- you might like to try it just for fun.

  • Fixing with glue is a manual post-processing step once auto conversion is complete

[Set_Default_Figure_Size]_for_figures_generated_by_code

Morning @jstac , @mmcky and @AakashGfude ,

In all our QE lectures, we have two kinds of figures:

  1. figures generated by code and
  2. figures directly inserted into the contexts.

As we discussed a long time ago and elsewhere (in Feb and in some other places), we'd love to set the default size for most figures in the 1st category (possibly the 2nd category as well?).

  • For some other special figures in the 1st category, we can specify their figure size directly in the plotting code.

Right now, we use the code plt.rcParams['figure.figsize'] = (10,6) explicitly in the imports part to set the default figure-plot size in a lecture.

As we discussed before, we may want to embed this setting into the conversion process.

Anyway, I think our current migration for programming lectures should be a good place for us to start this job.

I'd love to hear your comments.

(We could create another issue for setting default figure size for the 2nd category figures as mentioned above.)

Lessons for lecture-python, lecture-python-programming migration

  • fix nested list spacing from 4 spaces to 3 spaces using vscode global search and replace using _ _ _ _ #. and _ _ _ _ * patterns. The actual rule is to match the letter so this is 2 spaces following unordered list * and 3 spaces following ordered lists #.

[pandas] code-block:: none issues

Currently code-block:: none was used to denote code that wasn't to be executed.
The jupyter-book ecosystem pays no attention to this and includes these blocks as code.

pandas lecture has:

.. code-block:: none

    https://research.stlouisfed.org/fred2/series/UNRATE/downloaddata/UNRATE.csv

and produces the following md

```{code-cell} none
https://research.stlouisfed.org/fred2/series/UNRATE/downloaddata/UNRATE.csv
```

this is a correct translation but will need to adapt the sources (or get jupyter-book to respect multilanguage code-blocks)

Fixes Needed for sphinxcontrib-tomyst

  • copy of _static folder is not present in _build/myst. It will also need to be put in the source location rather than the _build location.
  • contents directive not being parsed correctly (See #3) [fixed by this PR]

[FIX] index elements not being parsed by `jupyter-book`

It looks like index elements aren't being recognised by jupyter-book properly so need to look into this. It doesn't appear to alter the html output but produces a significant number of warnings -- which makes useful warnings hard to see.

single: SciPy; Linear Algebra
/Users/matthewmckay/repos-collab/lecture-python-programming.myst/source/writing_good_code.md:23: WARNING: Directive 'index': 1 argument(s) required, 0 supplied

single: Models; Code style

We need to either:

  • translate without index elements parsed until jupyter-book supports them
  • fix syntax to make compatible with jupyter-book

list number error (when contains math)

Hi @mmcky ,

When list contains math, list number goes wrong like below.
[lecture:writing good code]
Screen Shot 2020-09-23 at 9 30 00 pm

[lecture: OOP]
Screen Shot 2020-09-23 at 9 30 48 pm

However, md does not seem to be wrong.

1. sets $k_0 = 1$
1. iterates using {eq}`gc_solmod` to produce a sequence $k_0, k_1, k_2 \ldots , k_T$
1. plots the sequence
1. Evaluate the polynomial {eq}`polynom`, returning $p(x)$ for any $x$.
1. Differentiate the polynomial, replacing the original coefficients with those of its derivative $p'$.

[Github Actions] Issue with Pandas and API Calls

OK so there is an issue with pandas and api calls to a data service when running these in parallel.

We will need to:

  • split the osx, linux and windows into separate workflows and then set different times.

[getting_started] syntax issues

In getting started lecture the following

``!conda install quantecon``

is getting translated to:

`> !conda install quantecon`

which suggests there is an extra block quote in the AST

[theme] where should pdf assets go?

To support migration we will reference the old single page pdf from lecture-python-programming for now.

What location are pdf files pulled from?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.