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

Fix code blocks indents in .md files #2978

Merged
merged 4 commits into from
Nov 13, 2020

Conversation

fanzhuyifan
Copy link
Contributor

Previously a lot of the code blocks in markdown files were horribly indented with bad white spaces in the beginning of lines. Users can't just select, copy, paste, and run (in the case of python). I have fixed all these, so there is no longer any code block with bad white space at the beginning of the lines.
It would be nice if you could try to make sure in future commits that all code blocks are properly indented inside and have the right amount of white space in the beginning!

Previously a lot of the code blocks in markdown files were horribly indented with bad white spaces in the beginning of lines. Users can't just select, copy, paste, and run (in the case of python). I have fixed all these, so there is no longer any code block with bad white space at the beginning of the lines.
It would be nice if you could try to make sure in future commits that all code blocks are properly indented inside and have the right amount of white space in the beginning!
@fanzhuyifan
Copy link
Contributor Author

This is a follow up to this pull request.

@@ -50,9 +50,9 @@ def rdd(data: RDD[ImageFeature]): DistributedImageSet
Create DistributedImageSet from rdd of ImageFeature

* data: array of ImageFeature
```
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Well, I guess this is a mis-modify. Pls keep them in the same style.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah you are right. Fixed

@qiyuangong
Copy link
Contributor

qiyuangong commented Oct 21, 2020

Nice PR! This PR is very helpful for our repo & our customers. Thank you @fanzhuyifan 👍

One small suggestion about this PR: if PR changes too many files (more than 10 files), pls split it into several ones.

Add @hkvision for style review.

@fanzhuyifan
Copy link
Contributor Author

Ok sure! I will remember to do that in the future!
Do you mean split into several commits or split into several PRs?

@qiyuangong
Copy link
Contributor

Ok sure! I will remember to do that in the future!
Do you mean split into several commits or split into several PRs?

Several PR. Small PR is easy to Review/Merge, while large PR may leads to long review period or discussion.

@@ -437,22 +437,22 @@ For the complete examples of NNFrames, please refer to:
into DataFrame.

Scala:
```scala
```scala
val imageDF = NNImageReader.readImages(imageDirectory, sc)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think ```scala would be unchanged; instead remove the tab at the beginning of the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


The output DataFrame contains a sinlge column named "image". The schema of "image" column can be
accessed from `com.intel.analytics.zoo.pipeline.nnframes.DLImageSchema.byteSchema`.
Each record in "image" column represents one image record, in the format of
Row(origin, height, width, num of channels, mode, data), where origin contains the URI for the image file,
and `data` holds the original file bytes for the image file. `mode` represents the OpenCV-compatible
type: CV_8UC3, CV_8UC1 in most cases.
```scala
```scala
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above for this file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 23 to 24
master=... // spark master
${ANALYTICS_ZOO_HOME}/bin/spark-shell-with-zoo.sh \
Copy link
Contributor

Choose a reason for hiding this comment

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

These two lines should be modified as well :)

Copy link
Contributor Author

@fanzhuyifan fanzhuyifan Oct 22, 2020

Choose a reason for hiding this comment

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

Could you take a look if this commit is good?

Change indent from 3 spaces to 4, and add "\" for multiline bash commands

@@ -32,7 +32,7 @@ In NeuralCFexample and WideAndDeepExample, we demostrate how to use Analyticd Zo

### Run the wide and deep example with Census Income dataset
``` bash
export ANALYTICS_ZOO_HOME=the folder where you extract the downloaded Analytics Zoo zip package
export ANALYTICS_ZOO_HOME=the folder where you extract the downloaded Analytics Zoo zip package
master=... // spark master
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above

Copy link
Contributor

@qiyuangong qiyuangong left a comment

Choose a reason for hiding this comment

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

LGTM

@hkvision
Copy link
Contributor

Thanks @fanzhuyifan so much! I will do the review for all files and you don't need to split into separate files this time 🥇

Change indent from 3 spaces to 4, and add "\" for multiline bash commands
@fanzhuyifan fanzhuyifan mentioned this pull request Oct 22, 2020
@fanzhuyifan
Copy link
Contributor Author

I just realized I have not checked that these changes work under the html renderer used to generate the website. They work for the build-in Github viewer, but may not work for the website generator. See here for an example of a break

```python
[[[[[ 0.8402289 0.11503692 0.27831015]
[ 0.45756199 0.15043262 0.78778086]]
```python
Copy link
Contributor

Choose a reason for hiding this comment

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

revert this line back and just remove the spaces before [[?

@@ -36,7 +36,7 @@ Each record in "image" column represents one image record, in the format of
Row(origin, height, width, num of channels, mode, data), where origin contains the URI for the image file,
and `data` holds the original file bytes for the image file. `mode` represents the OpenCV-compatible
type: CV_8UC3, CV_8UC1 in most cases.
```scala
```scala
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

@@ -46,7 +46,7 @@ type: CV_8UC3, CV_8UC1 in most cases.
StructField("mode", IntegerType, false) ::
// Bytes in OpenCV-compatible order: row-wise BGR in most cases
StructField("data", BinaryType, false) :: Nil)
```
```
Copy link
Contributor

Choose a reason for hiding this comment

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

??

@@ -51,7 +51,7 @@ You can run a analytics zoo program, e.g., the [Object Detection](https://github
1. Download the pre-trained model from [here](https://github.com/intel-analytics/analytics-zoo/blob/master/docs/docs/ProgrammingGuide/object-detection.md).
2. Prepare predict images
3. Run the following command:
```bash
```bash
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Comment on lines +22 to +23
export ANALYTICS_ZOO_HOME=the folder where you extract the downloaded Analytics Zoo zip package \
master=spark master \
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think \ is needed for these two lines?
Users can't directly paste these two lines but need to set properly according to their environment.
These two lines should be executed separately first followed by spark-shell

--dataset ml-1m
export ANALYTICS_ZOO_HOME=the folder where you extract the downloaded Analytics Zoo zip package \
master=spark master \
${ANALYTICS_ZOO_HOME}/bin/spark-shell-with-zoo.sh \
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the space this line?

--maxEpoch 20 \
--dataset census
export ANALYTICS_ZOO_HOME=the folder where you extract the downloaded Analytics Zoo zip package \
master=spark master \
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

@hkvision
Copy link
Contributor

@hkvision
Copy link
Contributor

Thanks so much for your contributions @fanzhuyifan
For the remaining several minor issues in this PR, we would take over to modify them :)

@hkvision hkvision merged commit c11f797 into intel-analytics:master Nov 13, 2020
@fanzhuyifan
Copy link
Contributor Author

fanzhuyifan commented Nov 13, 2020

Thanks so much for your contributions @fanzhuyifan
For the remaining several minor issues in this PR, we would take over to modify them :)

Thanks! Here's what happened:

  1. I realized my changes might break the website because the md renderer you are using is different from the default md renderer GitHub uses or the md renderer am I using.
  2. To make sure I am not breaking things, I wanted to test by generating the html files the way you are generating them. So I tried to generate the html pages using the instructions here. But
    1. By default it pulls the origin/master branch and uses that for html generation, which is unfortunate, since obviously I want to test my own local branch.
    2. It uses a directory /tmp/zoo-doc/ hard-coded into the python file, which is also unfortunate.
  3. After I sorted those things out and got gen_site.py happily running on my local version of files, it asked me to install spark! But I don't want to install spark just to render some markdown files into html pages.
  4. So I gave up.

If you could tell me some simple way to test whether my edits will actually work as expected on the html pages of the site, I am happy to test them out.

@hkvision hkvision mentioned this pull request Nov 16, 2020
@hkvision
Copy link
Contributor

Hi @fanzhuyifan I totally understand your points. Seems we are using Spark for rendering Python docs lol. Never mind and we have followed your contributions to further polish our docs. Thank so much and look forward to your future commits!

dding3 pushed a commit to dding3/analytics-zoo that referenced this pull request Oct 4, 2021
* Fix code blocks indents in .md files

Previously a lot of the code blocks in markdown files were horribly indented with bad white spaces in the beginning of lines. Users can't just select, copy, paste, and run (in the case of python). I have fixed all these, so there is no longer any code block with bad white space at the beginning of the lines.
It would be nice if you could try to make sure in future commits that all code blocks are properly indented inside and have the right amount of white space in the beginning!

* Fix small style issue

* Fix indents

* Fix indent and add \ for multiline commands

Change indent from 3 spaces to 4, and add "\" for multiline bash commands

Co-authored-by: Yifan Zhu <fanzhuyifan@gmail.com>
glorysdj added a commit that referenced this pull request Oct 14, 2021
* add hyperzoo for k8s support (#2140)

* add hyperzoo for k8s support

* format

* format

* format

* format

* run examples on k8s readme (#2163)

* k8s  readme

* fix jdk download issue (#2219)

* add doc for submit jupyter notebook and cluster serving to k8s (#2221)

* add hyperzoo doc

* add hyperzoo doc

* add hyperzoo doc

* add hyperzoo doc

* fix jdk download issue (#2223)

* bump to 0.9s (#2227)

* update jdk download url (#2259)

* update some previous docs (#2284)

* K8docsupdate (#2306)

* Update README.md

* Update s3 related links in readme  and documents (#2489)

* Update s3 related links in readme  and documents

* Update s3 related links in readme and documents

* Update s3 related links in readme and documents

* Update s3 related links in readme and documents

* Update s3 related links in readme and documents

* Update s3 related links in readme and documents

* update

* update

* modify line length limit

* update

* Update mxnet-mkl version in hyper-zoo dockerfile (#2720)

Co-authored-by: gaoping <pingx.gao@intel.com>

* update bigdl version (#2743)

* update bigdl version

* hyperzoo dockerfile add cluster-serving (#2731)

* hyperzoo dockerfile add cluster-serving

* update

* update

* update

* update jdk url

* update jdk url

* update

Co-authored-by: gaoping <pingx.gao@intel.com>

* Support init_spark_on_k8s (#2813)

* initial

* fix

* code refactor

* bug fix

* update docker

* style

* add conda to docker image (#2894)

* add conda to docker image

* Update Dockerfile

* Update Dockerfile

Co-authored-by: glorysdj <glorysdj@gmail.com>

* Fix code blocks indents in .md files (#2978)

* Fix code blocks indents in .md files

Previously a lot of the code blocks in markdown files were horribly indented with bad white spaces in the beginning of lines. Users can't just select, copy, paste, and run (in the case of python). I have fixed all these, so there is no longer any code block with bad white space at the beginning of the lines.
It would be nice if you could try to make sure in future commits that all code blocks are properly indented inside and have the right amount of white space in the beginning!

* Fix small style issue

* Fix indents

* Fix indent and add \ for multiline commands

Change indent from 3 spaces to 4, and add "\" for multiline bash commands

Co-authored-by: Yifan Zhu <fanzhuyifan@gmail.com>

* enable bigdl 0.12 (#3101)

* switch to bigdl 0.12

* Hyperzoo example ref (#3143)

* specify pip version to fix oserror 0 of proxy (#3165)

* Bigdl0.12.1 (#3155)

* bigdl 0.12.1

* bump 0.10.0-Snapshot (#3237)

* update runtime image name (#3250)

* update jdk download url (#3316)

* update jdk8 url (#3411)

Co-authored-by: ardaci <dongjie.shi@intel.com>

* update hyperzoo docker image (#3429)

* update hyperzoo image (#3457)

* fix jdk in az docker (#3478)

* fix jdk in az docker

* fix jdk for hyperzoo

* fix jdk in jenkins docker

* fix jdk in cluster serving docker

* fix jdk

* fix readme

* update python dep to fit cnvrg (#3486)

* update ray version doc (#3568)

* fix deploy hyperzoo issue (#3574)

Co-authored-by: gaoping <pingx.gao@intel.com>

* add spark fix and net-tools and status check (#3742)

* intsall netstat and add check status

* add spark fix for graphene

* bigdl 0.12.2 (#3780)

* bump to 0.11-S and fix version issues except ipynb

* add multi-stage build Dockerfile (#3916)

* add multi-stage build Dockerfile

* multi-stage build dockerfile

* multi-stage build dockerfile

* Rename Dockerfile.multi to Dockerfile

* delete Dockerfile.multi

* remove comments, add TINI_VERSION to common arg, remove Dockerfile.multi

* multi-stage add tf_slim

Co-authored-by: shaojie <shaojiex.bai@intel.com>

* update hyperzoo doc and k8s doc (#3959)

* update userguide of k8s

* update k8s guide

* update hyperzoo doc

* Update k8s.md

add note

* Update k8s.md

add note

* Update k8s.md

update notes

* fix 4087 issue (#4097)

Co-authored-by: shaojie <shaojiex.bai@intel.com>

* fixed 4086 and 4083 issues (#4098)

Co-authored-by: shaojie <shaojiex.bai@intel.com>

* Reduce image size (#4132)

* Reduce Dockerfile size
1. del redis stage
2. del flink stage
3. del conda & exclude some python packages
4. add copies layer stage

* update numpy version to 1.18.1

Co-authored-by: zzti-bsj <shaojiex.bai@intel.com>

* update hyperzoo image (#4250)

Co-authored-by: Adria777 <Adria777@github.com>

* bigdl 0.13 (#4210)

* bigdl 0.13

* update

* print exception

* pyspark2.4.6

* update release PyPI script

* update

* flip snapshot-0.12.0 and spark2.4.6 (#4254)

* s-0.12.0 master

* Update __init__.py

* Update python.md

* fix docker issues due to version update (#4280)

* fix docker issues

* fix docker issues

* update Dockerfile to support spark 3.1.2 && 2.4.6 (#4436)

Co-authored-by: shaojie <otnw_bsj@163.com>

* update hyperzoo, add lib for tf2 (#4614)

* delete tf 1.15.0 (#4719)

Co-authored-by: Le-Zheng <30695225+Le-Zheng@users.noreply.github.com>
Co-authored-by: pinggao18 <44043817+pinggao18@users.noreply.github.com>
Co-authored-by: pinggao187 <44044110+pinggao187@users.noreply.github.com>
Co-authored-by: gaoping <pingx.gao@intel.com>
Co-authored-by: Kai Huang <huangkaivision@gmail.com>
Co-authored-by: GavinGu07 <55721214+GavinGu07@users.noreply.github.com>
Co-authored-by: Yifan Zhu <zhuyifan@stanford.edu>
Co-authored-by: Yifan Zhu <fanzhuyifan@gmail.com>
Co-authored-by: Song Jiaming <litchy233@gmail.com>
Co-authored-by: ardaci <dongjie.shi@intel.com>
Co-authored-by: Yang Wang <yang3.wang@intel.com>
Co-authored-by: zzti-bsj <2779090360@qq.com>
Co-authored-by: shaojie <shaojiex.bai@intel.com>
Co-authored-by: Lingqi Su <33695124+Adria777@users.noreply.github.com>
Co-authored-by: Adria777 <Adria777@github.com>
Co-authored-by: shaojie <otnw_bsj@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants