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

Changed spark-api project name to source{d} engine in documentation #110

Merged
merged 11 commits into from
Oct 19, 2017
Merged

Changed spark-api project name to source{d} engine in documentation #110

merged 11 commits into from
Oct 19, 2017

Conversation

mcarmonaa
Copy link
Contributor

@mcarmonaa mcarmonaa commented Oct 16, 2017

Closes #66

  • As first step to renaming, only those references to spark-api in documentation that don't brake links or commands have been changed to source{d} engine

  • Related to Change project name #66

@codecov
Copy link

codecov bot commented Oct 16, 2017

Codecov Report

Merging #110 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #110   +/-   ##
=======================================
  Coverage   90.79%   90.79%           
=======================================
  Files          22       22           
  Lines         619      619           
  Branches       53       53           
=======================================
  Hits          562      562           
  Misses         57       57

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd8de97...b19f721. Read the comment docs.

README.md Outdated

```bash
$ spark-shell --packages com.github.src-d:spark-api:master-SNAPSHOT --repositories https://jitpack.io
```

To start using spark-api from the shell you must import everything inside the `tech.sourced.api` package (or, if you prefer, just import `SparkAPI` and `ApiDataFrame` classes):
To start using source{d} engine from the shell you must import everything inside the `tech.sourced.api` package (or, if you prefer, just import `SparkAPI` and `ApiDataFrame` classes):
Copy link
Contributor

Choose a reason for hiding this comment

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

we'll have to change this as well when we rename it in the code

@mcarmonaa
Copy link
Contributor Author

  • Changes in links and code examples have been changed based on rename SparkAPI to Engine #111
  • For links and jitpack coordinates I supposed the project namespace will be github.com/src-d/engine instead of github.com/src-d/spark-api

@mcarmonaa
Copy link
Contributor Author

  • Jupyter notebook has been updated to include an UAST extraction example and use the renaming module sourced.engine

@mcarmonaa
Copy link
Contributor Author

MORE CHANGES

  • Updated notebook and examples to be aligned with the last api changes
  • Added examples of the new XPath query feature

@@ -14,6 +14,8 @@ Here you can find a list of annotated *spark-api* examples:

- [pyspark's shell classifying languages and extracting UASTs](pyspark/pyspark-shell-lang-and-uast.md)

-[pyspark's shell querying UASTs with XPath](pyspark/pyspark-shell-xpath-query.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

missing whitespace between - and [ changes the MD formatting


Finally, `extract_tokens()` method will generate a column `tokens` based on the previous generated column `result`.

```python
Copy link
Contributor

@bzz bzz Oct 18, 2017

Choose a reason for hiding this comment

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

May be it's better to remove info string python here and in all similar cases, as the code below is not just a Python and gets highlighted very random

screen shot 2017-10-18 at 3 15 09 pm

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll show the code examples just as a plain text

@bzz
Copy link
Contributor

bzz commented Oct 18, 2017

👍
@mcarmonaa 9033f80 fixes line number 31 for spark but line 17 for pyspark is still there

@mcarmonaa
Copy link
Contributor Author

@bzz solved

scala> val engine = Engine(spark, "/path/to/siva-files")
engine: tech.sourced.engine.Engine = tech.sourced.engine.Engine@7e18b9e6

scala> api.getRepositories.getHEAD.getFiles.classifyLanguages.where('lang === "Python").extractUASTs.queryUAST("//*[@roleIdentifier]", "uast", "result").extractTokens("result", "tokens").select('path, 'lang, 'uast, 'tokens).show
Copy link
Contributor

Choose a reason for hiding this comment

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

api -> engine

@bzz
Copy link
Contributor

bzz commented Oct 18, 2017

Great job @mcarmonaa !

One thing I have noticed, while going though all https://github.com/mcarmonaa/spark-api/blob/fix/doc-project-name/_examples/scala/ - is that it's very annoying not to be able to copy the full commands from the docs.

I.e if https://github.com/mcarmonaa/spark-api/blob/fix/doc-project-name/_examples/scala/spark-shell-xpath-query.md#querying-uasts-with-xpath-example we have

$ spark-shell --packages com.github.src-d:engine:master-SNAPSHOT --repositories https://jitpack.io
scala> import tech.sourced.engine._
import tech.sourced.engine._

scala> val engine = Engine(spark, "/path/to/siva-files")
engine: tech.sourced.engine.Engine = tech.sourced.engine.Engine@7e18b9e6

engine.getRepositories.getHEAD.getFiles.classifyLanguages.where('lang === "Python").extractUASTs.queryUAST("//*[@roleIdentifier]", "uast", "result").extractTokens("result", "tokens").select('path, 'lang, 'uast, 'tokens).show
+--------------------+------+-------------+--------------------+
|                path|  lang|         uast|              tokens|
+--------------------+------+-------------+--------------------+
...

but if that would have been

$ spark-shell --packages com.github.src-d:engine:master-SNAPSHOT --repositories https://jitpack.io
import tech.sourced.engine._
val engine = Engine(spark, "/path/to/siva-files")
engine.getRepositories.getHEAD.getFiles.classifyLanguages.where('lang === "Python").extractUASTs.queryUAST("//*[@roleIdentifier]", "uast", "result").extractTokens("result", "tokens").select('path, 'lang, 'uast, 'tokens).show

it would have next advantages:

  • look better due to syntax hightligh
  • be copy-able for a user

What do you guys think?

README.md Outdated

You can launch our docker container which contains some Notebooks examples just running:

docker run --name spark-api-jupyter --rm -it -p 8888:8888 -v $(pwd)/path/to/siva-files:/repositories --link bblfsh:bblfsh srcd/spark-api-jupyter
docker run --name engine-jupyter --rm -it -p 8888:8888 -v $(pwd)/path/to/siva-files:/repositories --link bblfsh:bblfsh srcd/engine-jupyter
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be updated: bblfsh is now bblfshd since line 71

@erizocosmico
Copy link
Contributor

#111 has been merged, we can merge this as soon as it's ready

@mcarmonaa
Copy link
Contributor Author

LAST CHANGES

  • Fixed some wrong words.
  • The examples have been changed to follow @bzz suggestions.

@erizocosmico erizocosmico mentioned this pull request Oct 19, 2017
@erizocosmico
Copy link
Contributor

Python build fails for latest changes. Also, can you rebase? There were massive changes with the renaming in the code

Copy link
Contributor

@erizocosmico erizocosmico left a comment

Choose a reason for hiding this comment

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

lgtm, good job!

@@ -26,6 +28,8 @@ Here you can find a list of annotated *spark-api* examples:

- [spark-shell classifying languages and extracting UASTs](scala/spark-shell-lang-and-uast.md)

- [spark-shell querying UASTs with XPath](scala/spark-shell-xpath-query.md)

### jupyter notebooks

- [Basic example](notebooks/Basic%2BExample.ipynb)
Copy link
Contributor

@bzz bzz Oct 19, 2017

Choose a reason for hiding this comment

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

When rendered, this link gets broken i.e here https://github.com/mcarmonaa/spark-api/tree/fix/doc-project-name/_examples

Is that expected to work only on docSrv or shall it point elsewhere?

@bzz
Copy link
Contributor

bzz commented Oct 19, 2017

Looks great, thank you @mcarmonaa !

LGTM sans minor issue from above

@erizocosmico erizocosmico merged commit 0db9867 into src-d:master Oct 19, 2017
@mcarmonaa mcarmonaa deleted the fix/doc-project-name branch October 19, 2017 09:43
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.

None yet

3 participants