Giter VIP home page Giter VIP logo

onebone's Introduction

onepredict logo

Documentation Status Code style: black All Contributors

Summary

onebone is an open-source software for signal analysis about predictive maintenance, being used for research activities at ⓒ ONEPREDICT Corp.. It includes modules for preprocessing, health feature, and more. If you need to analyze signals for industrial equipments like turbines, a rotary machinery or componets like gears, bearings, give onebone a try!

The directory is as follows:

.
├── docs
├── onebone
│ ├── feature
│ ├── math
│ ├── preprocessing
│ ├── signal
│ └── utils
├── tests
├── tools
├── README.md
├── Makefile
└── pyproject.toml

Documentation

This reference manual details functions included in onebone, describing what they are and what they do. For learning how to use onebone, see the complete documentation.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Kyunghwan Kim

💻 📖 👀

Kangwhi Kim

💻 📖 👀

DaeyeopN

💻

Kibum Fred Kim

💻👀

Kibum Park

💻 👀

sewon.kim

💻

jeonjuna

💻

SunjinKim

💻

Hyunjae Kim

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Getting started

Prerequisite

onebone requires Python 3.8+.

Installation

onebone can be installed via pip from PyPI

$ pip install onebone

It can be checked as follows whether the onebone has been installed.

>>> import onebone
>>> onebone.__version__

Usage

It assumes that the user has already installed the onebone package.

You can import directly the function, for example:

>>> from onebone.feature import tacho_to_rpm

Call for contribute

We appreciate and welcome contributions. Small improvements or fixes are always appreciated; issues labeled as "good first issue" may be a good starting point.

Writing code isn't the only way to contribute to onebone. You can also:

  • triage issues
  • review pull requests
  • help with outreach and onboard new contributors

If you're unsure where to start or how your skills fit in, reach out! You can ask here, on GitHub, by leaving a comment on a relevant issue that is already open.

If you want to use an code for signal analysis, but it's not in onebone, make a issue.

Please follow this guide to contribute to onebone.

If you are new to contributing to open source, this guide helps explain why, what, and how to get involved.

References

onebone's People

Contributors

akangel0307 avatar allcontributors[bot] avatar castedice avatar daeyeopn avatar dependabot[bot] avatar hjkim-onepredict avatar isingmodel avatar kangwhi-kim avatar kbpark-onepredict avatar kyunghwan-onepredict avatar seone-kim avatar ybpark-onepredict avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

onebone's Issues

FFT full spectrum 추가

현재 구현되어있는 half spectrum과 다른 full spectrum 알고리즘 추가
현재 가디원 터보 2.0에서 사용되고 있으며 진동 진단에 필요

ideal bandpass filter 추가

현재 가디원 터보 2.0에서 사용 중인 ideal bandpass filter 추가
기존의 butterworth bandpass filter와 원리가 달라 결과값 또한 다름
전사적으로 사용 가능성 높음

signal processing 함수 input이 3차원 이상인 경우 동작하지 않음

pytorch를 쓰려고하고 예를 들어 신호의 dimension을 다음과 같이 정의했을때가 있음.
|signal| = (batch size, channel size, signal length)
ex) 전류 3상 신호, 계측시 10000 포인트 계측, 100번 반복 -> (100, 3, 10000)
이 경우 signal.fft, signal.filter 함수가 동작하지 않음

rolling 함수 구현 및 rolling 함수와 연동될 기타 함수 구현

moving average는 rolling 함수와 average 함수의 조합으로 나눌 수 있음
또한 rolling에 대한 다양한 파라미터를 받을 수 있으며
average 함수 외에도 다른 함수를 조합하여 다양한 파생 함수를 만들 수 있음

moving average의 개선 혹은 상위가 되는 모듈을 구현할 예정

docs: `positive_fft` example 수정

N = 400 # array length
fs = 800 # Sampling frequency
T = 1 / fs # Sample interval time
x = np.linspace(0.0, N * T, N, endpoint=False) # time
y = 3 * np.sin(50.0 * 2.0 * np.pi * x) + 2 * np.sin(80.0 * 2.0 * np.pi * x)
signal = y
f, x_mag = positive_fft(signal, fs, hann = False, normalization = False, axis = -1)
freq = np.around(f[np.where(x_mag > 1)])
freq

Fs -> fs,
axix -> axis ,
false -> False,
mag -> x_mag

feat: Adding 'Hampel Filter' function to onebone.feature

시계열 구조의 데이터에서 Outlier 로 판정되는 값을 감지후, trend 를 해치지 않는 형태로 대치해주는 Filter


구현 목적 :

  • 모델이 학습시, 사용될 데이터에서 Outlier 가 많다면 잘못된 학습을 유도할 수 있기 때문에 해당 문제를 해결하기 위해 사용함.

우려되는 점 :

  • 검색해보니, Python (2021년도), R & matlab ( 2020 년도) 에 이미 구현 된 내용들이 존재하며, 직접 알고리즘을 구현해보고 다른곳에서 구현한 것들과 비교시 큰 차이가 없거나 내가 구현한게 더 별로면 정리 형식으로 바꿀 예정
  • 타 Outlier 제거 필터들에 비해 이게 어떤 차별점이나, 얼마나 성능이 좋을지 확인해봐야한다.

예상되는 한계점 :

  1. 하나의 데이터에 대해서만 outlier 를 제거할 수 있다. 즉, data1 과 data2 를 비교했을때, 같은 시점에서 발생하는 Outlier 를 제거하고 싶을땐 불가능하다.
    1-1) 해결 방안 : Outlier 의 index 를 추출후, 같은 시점의 Index 만 날리는 방향으로 하면됨

  2. window size 를 사용자가 직접 지정하여 가장 적합한 size를 선정해야하는 수고스러움이 생길것 같다.
    2-1) 해결방안 : 사용자가 범위를 지정하면 그 범위 내에서 어떤 size 를 선정했을때, 가장 적합한지 보여주면 될 것 같다.

다차원 지원 방법 제안(예정)

numpy나 scipy의 대부분의 함수는 axis를 인자로 받아서 다차원에서도 작동이 가능함
하지만 일부 함수는 다차원을 지원하지 않기 때문에 numpy.apply_along_axis와 같은 함수를 이용해서 다차원 연산이 가능하도록 해야 함

현재 후자의 케이스가 많지 않지만, 앞으로 추가되는 함수에서 반복적으로 발생할 수가 있을 것으로 예상됨
따라서 numpy의 axis를 모사하는 데코레이터 클래스를 구현하고 이를 1차원으로 구현한 함수에 적용하는 방식으로 구현하는 것을 제안

Promotion about OpenSource

Promotion about OpenSource

  • onebone에 대한 홍보 전략과 실행이 필요함. 아래 내용을 참고하면 좋을 듯.
  • Reference: promote-open-source-project

1. 🎢 Preparation step


👌 Make sure your project is mature enough

Your project must be stable enough with minimum viable features in order to hook users.

😎 Choose a cool name for your project

Choose a name users can easily remember.

💅 Make your README pretty

README is the first thing your visitors will see. Make it simple, pretty and easy to read. Here is a list of beautiful READMEs.

💪 Highlight strong points of your project

Identify your project strengths and make sure visitors see them first.

✨ Provide a demo of your project

Visitors will want to quickly understand the purpose of your project, how it works and how to use it. Providing a demo is the best way to satisfy users. It could be:

  • An animated GIF demonstrating how your project works
  • A link to a live demo

👌 Install/Usage must be super easy

You'll probably lose visitors if your project is not user-friendly.

📘 Create a clean and well structured documentation

Creating a good documentation is probably the most important step. If you have a small documentation, you can include it within your README. Otherwise, you should probably host it in a separate website. Some open source projects like vuepress can help you creating clean documentation in a simple way.


2. 📢 Spread the word about your hard works


⭐ Make your project trustable before publishing it on social networks

Most visitors will check how many stars the project has before considering using it. A minimum amount of stars makes your project more trustable than a project with zero star. This is why you should ask people you know to support your project before doing a public announcement on social media.

↗️ Share the project on social media and specialized platforms

Tell the World about your awesome work! Publish on social media and specialized platforms:

📃 Write articles that mention your project

Write articles about your project. Purpose can be the technical stack you used, how your project works, problems you encountered, etc. Post to publishing platforms:

🎤 Present your project at conferences/meetups

Presenting your project at conferences or meetups is a good way to improve its visibility.

🎥 Record and publish videos presenting your project, how it works, etc

Recording a video is not an easy exercise. However it's probably the most efficient way to make your project famous.

🕐 Choose the best time to publish on social media

Don't publish during holidays period or weekends. Usually the best time to publish on social networks is mid-week.

🗑 Don't spam platforms with your promotion

Don't publish twice on the same platform. It will be considered as spam and might cause bad publicity for your project.


3. 🤝 Keep your users


🆕 Try to regularly release new versions of your project

Maintain and improve your project with new releases and generate changelogs.

❗ Maintain your project, process opened issues

Do not let opened issues without response. Be nice with people that took time to open issues. 😉

🙏 Invite users to contribute

A healthy project is a project with a community and contributors. Let your users know that you need help by tagging some issues with contribution welcome or good first issue labels. See github labels.

🏆 Reward contributors

Be nice with people that helped you! Some open source projects like gatsby reward contributors with goodies. If you can't afford that, do a public post (on twitter or other platforms) about the contribution and mention the author (here is an example of public thanks). Open a Contributors section in your README to publicly thank them or showcase them on your project documentation or website. Here are some examples:

💬 Open a community chat platform

Github issues are not always the best way to communicate with your users. If necessary, you can use chat platforms to discuss with them:

🔙 Ask for feedback

User feedback is the best way to improve your project. They probably have features and ideas that could make your project better.

❤️ Open a use case gallery to show what users built with your project

Visitors will trust your project if they see concrete use cases and success stories, e.g., the vuepress gallery.


onebone.feature.snr 네이밍 관련 문의

onebone.feature.snr (#59) 에 대한 문의입니다.
일반적으로 Signal to noise는 노이즈 대비 ROI 시그널의 신호 크기를 의미하는데, 어떤 성격의 시그널을 어떻게 분석하느냐에 따라 다른 방법이 쓰입니다. 이 측면에서 onebone.feature.snr에서는 너무 좁은 의미로 SNR을 구현한 것 아닌지 의구심이 듭니다. 함수 이름을 좀 더 직관적으로 바꾸면 어떨까요?

@seone-kim

onebone 함수들에 대해 numba 모듈을 추가하는 방안

onebone에 있는 모든 함수에 대해 적용할 필요는 없고, 적용할 수도 없겠지만 Numpy 기반으로 작성된 함수들에 대해서는 numba 모듈의 jit decorator을 이용하여 간단하게 성능을 크게 올릴 수 있습니다.

일단 급하게 업그레이드를 해야한다면 @jit 데코레이터만 추가하면 될 것 같고, 고도화한다면 numba에 대해 공부를 한 뒤 목적에 맞게 사용하면 될 거 같습니다.

성능 비교 관련 문서 : https://pythonspeed.com/articles/numba-faster-python/
호환성 이슈 : https://numba.pydata.org/numba-doc/latest/reference/pysupported.html#pysupported

hoxfix: pywt 패키지 의존성 문제

@kyunghwan-onepredict 경환님, $ poetry install(1)도중 PyWavelets 의존성관련하여 오류가 발생하네요.
그래서 pyproject.toml에서 PyWavelets 패키지 지우고 $ poetry add PyWavelets(2)로 최신버전으로 깔면 파이썬 버전 의존성때문에 설치가 안됩니다. 수정이 필요해보입니다.

제 생각은 Python version을 3.7~3.11로 변경해야할 것 같네요.

(1)

❯ poetry install
Installing dependencies from lock file
Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.

  SolverProblemError

  Because onebone depends on PyWavelets (1.1.1) which doesn't match any versions, version solving failed.

  at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│ 
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

(2)

 1 ❯ poetry add PyWavelets
Using version ^1.3.0 for PyWavelets

Updating dependencies
Resolving dependencies... (0.2s)

  SolverProblemError

  The current project's Python requirement (>=3.6.5,<3.11) is not compatible with some of the required packages Python requirement:
    - pywavelets requires Python >=3.7, so it will not be satisfied for Python >=3.6.5,<3.7
  
  Because pywavelets (1.3.0) requires Python >=3.7
   and no versions of pywavelets match >1.3.0,<2.0.0, pywavelets is forbidden.
  So, because onebone depends on PyWavelets (^1.3.0), version solving failed.

  at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│ 
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
    
    For pywavelets, a possible solution would be to set the `python` property to ">=3.7,<3.11"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers

bug: `onebone` 버전 업그레이드 동작 문제

$ pip list | grep onebone
>>> onebone                  1.0.1

$ pip install -U onebone
Requirement already satisfied: onebone in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (1.0.1)
Requirement already satisfied: matplotlib>=3.3.4 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from onebone) (3.4.3)
Requirement already satisfied: sklearn<0.1,>=0.0 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from onebone) (0.0)
Requirement already satisfied: numpy>=1.19.5 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from onebone) (1.21.3)
Requirement already satisfied: scipy>=1.5.4 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from onebone) (1.7.1)
Requirement already satisfied: pandas>=1.1.5 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from onebone) (1.3.4)
Requirement already satisfied: kiwisolver>=1.0.1 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from matplotlib>=3.3.4->onebone) (1.3.2)
Requirement already satisfied: python-dateutil>=2.7 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from matplotlib>=3.3.4->onebone) (2.8.2)
Requirement already satisfied: cycler>=0.10 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from matplotlib>=3.3.4->onebone) (0.11.0)
Requirement already satisfied: pyparsing>=2.2.1 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from matplotlib>=3.3.4->onebone) (2.4.7)
Requirement already satisfied: pillow>=6.2.0 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from matplotlib>=3.3.4->onebone) (8.4.0)
Requirement already satisfied: pytz>=2017.3 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from pandas>=1.1.5->onebone) (2021.3)
Requirement already satisfied: scikit-learn in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from sklearn<0.1,>=0.0->onebone) (1.0.1)
Requirement already satisfied: six>=1.5 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from python-dateutil>=2.7->matplotlib>=3.3.4->onebone) (1.16.0)
Requirement already satisfied: joblib>=0.11 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from scikit-learn->sklearn<0.1,>=0.0->onebone) (1.1.0)
Requirement already satisfied: threadpoolctl>=2.0.0 in /root/.pyenv/versions/3.9.0/envs/motor_algorithm/lib/python3.9/site-packages (from scikit-learn->sklearn<0.1,>=0.0->onebone) (3.0.0)

$ pip list | grep onebone
>>> onebone                  1.0.1

pip uninstall onebone 후에 pip install onebone을 하면 버전 업그레이드가 됨.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.