Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
izikeros committed Mar 21, 2024
2 parents 5ea61ae + 66add85 commit 6d312b6
Show file tree
Hide file tree
Showing 23 changed files with 3,935 additions and 1,725 deletions.
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ ignore =C, T003, M502, N802, F405, T001, D100, D101, D104, D105, D107, E203
#select = B

# Do not expect extensive documentation in tests
extend-ignore = D100,D101,D102,D103 ./tests/*
per-file-ignores =
./tests/*: D100,D101,D102,D103

exclude =
.tox,
Expand Down
1 change: 1 addition & 0 deletions .pdm-python
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Users/krystian.safjan/projects/priv/trend_classifier/.venv/bin/python
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files # prevents giant files from being committed.
- id: check-case-conflict # checks for files that would conflict in case-insensitive filesystems.
Expand All @@ -20,14 +20,14 @@ repos:

# A tool to automatically upgrade syntax for newer versions of the python language.
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.15.1
hooks:
- id: pyupgrade
args: [ --py38-plus ]
args: [ --py39-plus ]

# A formatter for finding and removing unused import statements.
- repo: https://github.com/hadialqattan/pycln
rev: v2.1.3
rev: v2.4.0
hooks:
- id: pycln
args: [ --all ]
Expand All @@ -37,24 +37,24 @@ repos:
# is set to the same style that is enforced by zimports.
# E.g. add `import-order-style = google` to your .flake8 file.
- repo: https://github.com/sqlalchemyorg/zimports/
rev: v0.6.0
rev: v0.6.1
hooks:
- id: zimports
args: [ --style=pycharm ]

# The uncompromising code formatter
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.3.0
hooks:
- id: black

# A tool to automatically fix common style issues in Python code. Has plugins.
- repo: https://github.com/pycqa/flake8
rev: '5.0.4' # fix to 5.0.4
rev: '7.0.0'
hooks:
- id: flake8
exclude: (__pycache__|.venv|tmp|.tox)
additional_dependencies: [ flake8-import-order, flake8-force-keyword-arguments, flake8-bugbear ]
additional_dependencies: [ flake8-import-order, flake8-bugbear ]

# Find common security issues in your Python code using bandit.
- repo: https://github.com/Lucas-C/pre-commit-hooks-bandit
Expand Down
46 changes: 35 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,43 @@
# Changelog

# 2022-09-08
All notable changes to this project will be documented in this file.

## Added
## [0.1.10] - 2024-03-21

- `.to_dataframe()` method for SegmentList.
### 📚 Documentation

# 2022-09-07
- Add visuals
- Add image
- Describe alternative approach to trend detection

## Added
### 🎨 Styling

- Trend segmentation and classification.
- Plotting the segments
- Plotting the trends
- Calculating metrics for the segments
- Reformat, minor refactorings

## Changed
### ⚙️ Miscellaneous Tasks

- Interface of the Segmenter class to simplify usage.
- Update tox requirements and config
- Update flak8 config to new version of flake8
- Add new Make targets
- Add ruff config

### Build

- Update ignored
- Drop support for python 3.8
- Migrate from poetry to pdm (gradually)

## [0.1.9] - 2023-05-26

### 📚 Documentation

- Rephrase comment

### Build

- Update Makefile
- Upgrade requirements
- Upgrade tox config
- Upgrade pre-commit config

<!-- generated by git-cliff -->
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ clean:
find . -type f -name "*.py[co]" -delete
find . -type d -name "__pycache__" -delete

## Create a virtual environment in the .venv folder in current directory.
create-venv:
@echo -e "$(COLOR_CYAN)Creating virtual environment in the project folder...$(COLOR_RESET)" && \
poetry config --local virtualenvs.in-project true
poetry shell

## Lint package using pre-commit
lint:
pre-commit run --all-files
Expand Down Expand Up @@ -68,6 +74,19 @@ update: tox_reqs_update
pre-commit gc
poetry update

## Install poetry plugins.
poetry-plugins:
@echo -e "$(COLOR_CYAN)Installing poetry plugins...$(COLOR_RESET)" && \
poetry self add poetry-audit-plugin
poetry self add poetry-plugin-export

## Run the check for vulnerabilities in the dependencies.
audit:
# NOTE: This requires the 'poetry-audit-plugin' to be installed.
# to install use e.g. $ poetry self add poetry-audit-plugin
@echo -e "$(COLOR_CYAN)Running security audit based on 'safety'...$(COLOR_RESET)"
poetry audit

#################################################################################
# Self Documenting Commands #
#################################################################################
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ seg.segments.to_dataframe()

(**NOTE:** for clarity reasons, not all columns are shown in the screenshot above)

## Alternative approach
- Smooth out the price data using the Savitzky-Golay filter,
- label the highs and lows.
- higher highs and higher lows indicates an uptrend.

The requirement here is than you need OHLC data for the assets you would like to analyse.

## License

[MIT](LICENSE) © [Krystian Safjan](https://safjan.com/).
2 changes: 1 addition & 1 deletion docs/visuals.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,4 @@ <h1>Index</h1>
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
</footer>
</body>
</html>
</html>
Loading

0 comments on commit 6d312b6

Please sign in to comment.