Skip to content

Commit

Permalink
Merge pull request #13 from MistyDi/dev
Browse files Browse the repository at this point in the history
2022-05-24 9:00 - Merge Dev

- fix #3
- fix #4 
- fix #7 
- fix #8
- fix #12
  • Loading branch information
dmitmatveev authored May 24, 2022
2 parents 59845b4 + 63317f5 commit cc03b6d
Show file tree
Hide file tree
Showing 7 changed files with 147,954 additions and 147,856 deletions.
7 changes: 7 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Recommendations

## Versions and git tags

Название версии должно придерживаться логики [**Semantic Versioning**](https://semver.org/) или то же
самое [SemVer](https://github.com/semver/semver/blob/master/semver.md)

# Further TODO


Expand Down
102 changes: 67 additions & 35 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,90 @@
## Makefile usage

Main entry-point to install all you need and to run `.ipynb` by jupyter-notebook:
- 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
```
⚠️NOTE 0: in case of successful installing, but something like jupyter-lab not found / not defined, you may need
to add some packages-directory to your PATH [PATH Ubuntu](https://localcoder.org/jupyter-command-jupyter-lab-not-found)
[PATH Windows](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/11)


- 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
```
_See NOTE 0 in case of "jupyter-lab not found" like._


- Updates `pip` of the **current** user:
```shell
make pip-update
```

- Updates `pip` and `pipenv` dependencies:
```shell
make update
```

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

Only builds the environment by the `pipenv`:

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

Adds the projects' `pipenv` environment as a kernel to jupyter-like (notebook/jupyter-lab):
```shell
make build_kernel
```
⚠️NOTE 3: all the commands here should be run under the repository dir.

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
```
## Set git-diff for the jupyter notebook files

Installs all you need and starts jupyter-notebook with the [data_analytics_task.ipynb](data_analytics_task.ipynb) opened:
```shell
make run
```
# installing `nbdime` inside of pipenv is possibly not a good idea: you will be able to run the nbdime only under
# the pipenv activated. In this case you especially don't want to enable in globally, so:

Installs all you need and starts jupyter-lab with the [data_analytics_task.ipynb](data_analytics_task.ipynb) opened:
```shell
make run-lab
# Installing globally:
pip install nbdime
# Setting integration with `git diff` globally:
nbdime config-git --enable --global
```

Updated `pip` and `pipenv` dependencies:
To disable:
```shell
update
nbdime config-git --disable --global
```

💡NOTE 1: maybe you also need to install pipenv-dev packages, then you should manually run the:
To compare with in WEB-interface:
```shell
pipenv install --dev
nbdiff-web
```

💡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.
Expand Down
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ build_kernel : build
echo "Starting of 'build_kernel'"
pipenv run python -m ipykernel install --user --name=$(D_KERNEL_ENV_NAME)

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

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

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

run : build-notebook build_kernel
echo "Starting of 'run'"
Expand All @@ -27,6 +26,10 @@ run-lab : build-lab build_kernel
echo "Starting of 'run-lab'"
jupyter lab $(D_NOTEBOOK)

update:
pip-update :
echo "Starting of 'pip-update'"
pip install --upgrade pip --user

update : pip-update
echo "Starting of 'update'"
pipenv update
3 changes: 3 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ ipykernel = "*"
numpy = "*"
pandas = "*"
plotly = "*"
pexpect = "*"
pillow = "*"
kaleido = "*"

[dev-packages]
pyppeteer = "*"
Expand Down
73 changes: 72 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
> Main python-packages used for (3): [`pandas`](https://pandas.pydata.org/), [`plotly`](https://plotly.com/python/).
Additional: `itertools`, `PIL`.
>
> Also, I tried: `Makefile` creating, using of [`pipenv`](https://pipenv.pypa.io/en/latest/),
[DataSpell](https://www.jetbrains.com/dataspell/) IDE, and several GitHub pretties.
> Also, I tried:
> - `Makefile` creating;
> - using of [`pipenv`](https://pipenv.pypa.io/en/latest/) for virtual environment;
> - [DataSpell](https://www.jetbrains.com/dataspell/) IDE;
> - several GitHub pretties (tagging by [SemVer](https://github.com/semver/semver/blob/master/semver.md), issues,
issue_templates, Pull Requests, releases);
> - Git-stuff (branching, merging, merge conflicts solving, cherry-picking, rebasing);
> - [`nbdime`](https://nbdime.readthedocs.io/en/latest/) for git-diff comparing of the `.ipynb`-files
> - KaTeX for writing math-formulas and math-equation inside of the Notion (see Test (1) below).
## Installing

Expand All @@ -16,6 +23,16 @@ See [INSTALL.md](INSTALL.md) for the info: installing is pretty-simple ;)

See [DEVELOPING.md](DEVELOPING.md): TODOs, recommendations

## (3) Data Analytics Test - Pandas/Plotly

See task description and task solution at [nbviewer.org - data_analytics_task.ipynb](https://nbviewer.org/github/MistyDi/data_analytics-math_python_pandas/blob/main/data_analytics_task.ipynb)
(with support)

Original source (but without plotly-plots visual): [data_analytics_task.ipynb](data_analytics_task.ipynb)

> To save visual plotly-plot and to be able to see them in GitHub - re-run the code with `PLOTLY_PLOT_SHOW_TYPE='svg'`,
defined in the one of the first code-cells. @dmitmatveev

## (1) Higher Maths Test

[Notion - Test 1 - Higher Math](https://www.notion.so/dmitmatveev/Dmitriy-Matveev-Test-1-Higher-Math-107a04e281704f678bd8d449caff7f97)
Expand All @@ -24,10 +41,6 @@ See [DEVELOPING.md](DEVELOPING.md): TODOs, recommendations

[Notion - Test 2 - Python Basic Definitions](https://dmitmatveev.notion.site/Dmitriy-Matveev-Test-2-Python-Basic-Definitions-634d136aeb1f49b5bc758469e84c42d2)

## (3) Data Analytics - Test 3 - Pandas/Plotly

See task description and task solution at [data_analytics_task.ipynb](data_analytics_task.ipynb)

### Get Started

To run the jupyter-notebook via jupyter you can simply use `Makefile` and do:
Expand Down
Loading

0 comments on commit cc03b6d

Please sign in to comment.