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

Merge Dev #1

Merged
merged 7 commits into from
May 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ docs/_build/
.pybuilder/
target/

# Jupyter Lab
.virtual_documents

# Jupyter Notebook
.ipynb_checkpoints

Expand Down Expand Up @@ -269,3 +272,8 @@ dmypy.json
# Cython debug symbols
cython_debug/

# MacOS dirs
__MACOSX/

# PDFs
*.pdf
38 changes: 38 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Further TODO


### Coding

- [ ] (?) Move helper-functions from the `.ipynb` to python-script
- [ ] (?) Try to define auto-linting and MyPy checking
- [ ] (?) Try to add pytest for the helper-functions
- [ ] Try to add Dockerfile

### Python Versions

- [ ] Check python3.9 support
- [ ] Check python3.8 support
- [ ] Check python3.7 support
- [ ] Check python3.6 support

### Docs and readability

- [ ] Export `README.md - Notions-data` to the `Markdown` and add to the repository directly
- [ ] Translate RU -> ENG
- [ ] Add support/link to run the `.ipynb` in Google Colab
- [ ] Add Table of Contents to the Markdown-files
- [ ] Add Table of Contents to the `.ipyng`


# PS Try DataSpell IDE

> *PS I Tried DataSpell IDE for Data Science - really cool and strong IDE with good-old features of JutBrains' PyCharm,
for example. It was pretty-easy to migrate from Jupyter Notebook / Jupyter Lab to the DataSpell because of the
familiar interface, tools, short-keys, I have used for while practicing with PyCharm. Try it!*

> *One of the best ways to receive longer educational-license, if you already are not a student, is to try some
Stepik Courses (like [Golang Programming \[RU\]](https://stepik.org/course/54403/), solve several tasks and get
licence-key for all JetBrains pack for a few mounts.*

> *Don't worry, if license will be close to end - you can receive it again, ..., by solving several tasks again :)
So you will have enough time to get to know with this IDE.*
85 changes: 85 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
## Makefile usage

Main entry-point to install all you need and to run `.ipynb` by jupyter-notebook:

```shell
make
# the same as `make run`
```

Only builds the environment by the `pipenv`:

```shell
make build
```

Adds the projects' `pipenv` environment as a kernel to jupyter-like (notebook/jupyter-lab):
```shell
make build_kernel
```

Installs jupyter notebook to global environment of the **current** user:
```shell
make build-notebook
```

Installs jupyter-lab to global environment of the **current** user:
```shell
make build-lab
```

Installs all you need and starts jupyter-notebook with the [data_analytics_task.ipynb](data_analytics_task.ipynb) opened:
```shell
make run
```

Installs all you need and starts jupyter-lab with the [data_analytics_task.ipynb](data_analytics_task.ipynb) opened:
```shell
make run-lab
```

Updated `pip` and `pipenv` dependencies:
```shell
update
```

💡NOTE 1: maybe you also need to install pipenv-dev packages, then you should manually run the:
```shell
pipenv install --dev
```

💡NOTE 2: starting/working with jupyter-lab maybe harder: you may some additional extension etc.

⚠️NOTE 3: all the commands here should be run under the repository dir.


## How to install new python-packages

> All installations should happen with `pipenv` command.

Note that some packages are needed only for developing, for example, `pytest` should be installed like:
```shell
pipenv install --dev pytest
```

Common packages, that will be needed in production code are installed as:
```shell
pipenv install tqdm
```

### How to activate the environment?

```shell
pipenv shell
```

Also you may (and possibly even should) add this pipenv interpreter to the PyCharm or eny other IDE.

For example, the current pipenv with the name has Pipfile and Pipfile.lock files in the repo, but actually the
environment with needed packages will be installed in your user-path.

In my case _(Windows 11, amd64)_: `C:/Users/{my_name}/.virtualenvs/pipenv-data_analytics_test/`,
so for the PyCharm I specify the python interpreter as
`C:/Users/{my_name}/.virtualenvs/pipenv-data_analytics_test/Scripts/python.exe`

For more info - see pipenv tutorial [Pipenv: Python Dev Workflow for Humans](https://pipenv.pypa.io/en/latest/).
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.DEFAULT_GOAL := run
D_KERNEL_ENV_NAME = "pipenv-data_analytics_test"
D_NOTEBOOK = "data_analytics_task.ipynb"

build_kernel : build
echo "Starting of 'build_kernel'"
pipenv run python -m ipykernel install --user --name=$(D_KERNEL_ENV_NAME)

build :
echo "Starting of 'build'"
pip install --upgrade pip --user
pipenv install

build-notebook :
echo "Starting of 'build-notebook'"
pip install notebook --user # installing globally for the user

build-lab :
echo "Starting of 'build-lab'"
pip install jupyterlab --user # installing globally for the user

run : build-notebook build_kernel
echo "Starting of 'run'"
jupyter notebook $(D_NOTEBOOK)

run-lab : build-lab build_kernel
echo "Starting of `run-lab`"
jupyter lab $(D_NOTEBOOK)

update:
pip install --upgrade pip --user
pipenv update
17 changes: 17 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
ipykernel = "*"
numpy = "*"
pandas = "*"
plotly = "*"

[dev-packages]
pyppeteer = "*"
nbconvert = "*"
jupyter-contrib-nbextensions = "*"

[requires]
Loading