%global _empty_manifest_terminate_build 0
Name:		python-toopazo-ulg
Version:	0.0.24
Release:	1
Summary:	Python package to process and plot Px4 .ulg files
License:	MIT License
URL:		https://github.com/toopazo/toopazo_ulg
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/b4/18/9a92a077e1b1f2f37b8d04ea68dcf013f168bd834a8ff12ffc7ee067c8f9/toopazo_ulg-0.0.24.tar.gz
BuildArch:	noarch


%description
# toopazo_ulg
This is the repository for the pip module ```https://pypi.org/project/toopazo-ulg/```

This is a simple python package that makes use of pyulog commands
(see https://github.com/PX4/pyulog ) to: parse, process and plot
Px4 .ulg log files ( see https://github.com/PX4/Firmware )


## How it works
It needs three folders: logs, tmp and plots (names are hardcoded).
It works by taking all .ulg files from the logs folder and then using
ulog2csv to writing the resulting .csv files in the tmp folder.
It finally writes all results in the plots folder.

## Dependencies
Install dependencies running pip as a module
```
 python3 -m pip install -U matplotlib
 python3 -m pip install -U numpy
 python3 -m pip install -U scipy
 python3 -m pip install -U toopazo_tools
```

## Usage
```
user@host: ls
logs tmp plots
user@host: python -m toopazo_ulg.plot_main --bdir tests/
```

## How to update a new version to https://pypi.org/  

This is note to myself about the necessary steps to upload a new version 
of the code to the repo in https://pypi.org/.

I wrote a bash file to automate the update and uploading process to pypi. 
It is can be executed in the terminal using

```
. ./update_library.sh
```

The steps involved are taken from https://widdowquinn.github.io/coding/update-pypi-package/

1. Update local packages for distribution
    ```
    python3 -m pip install --user --upgrade setuptools wheel
    python3 -m pip install --user --upgrade twine 
    ```
2. Open setup.py and change the version, e.g., version='1.0.3'. 
   This can be done automatically by running 
   ```
   python increment_setup_version.py
   ```
3. It is sometimes neccessary to delete the build/ and dist/ folder
    ```
    rm -r build/*
    rm -r dist/*
    ```
4. Create distribution packages on your local machine, and check
the dist/ directory for the new version files
    ```
    python3 setup.py sdist bdist_wheel
    ```
5. Upload the distribution files to https://pypi.org/ server
    ```
    python3 -m twine upload dist/*
    ```
6. Install the package from https://pypi.org/ server
    ```
    python3 -m pip install -U toopazo-tools
    ```




%package -n python3-toopazo-ulg
Summary:	Python package to process and plot Px4 .ulg files
Provides:	python-toopazo-ulg
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-toopazo-ulg
# toopazo_ulg
This is the repository for the pip module ```https://pypi.org/project/toopazo-ulg/```

This is a simple python package that makes use of pyulog commands
(see https://github.com/PX4/pyulog ) to: parse, process and plot
Px4 .ulg log files ( see https://github.com/PX4/Firmware )


## How it works
It needs three folders: logs, tmp and plots (names are hardcoded).
It works by taking all .ulg files from the logs folder and then using
ulog2csv to writing the resulting .csv files in the tmp folder.
It finally writes all results in the plots folder.

## Dependencies
Install dependencies running pip as a module
```
 python3 -m pip install -U matplotlib
 python3 -m pip install -U numpy
 python3 -m pip install -U scipy
 python3 -m pip install -U toopazo_tools
```

## Usage
```
user@host: ls
logs tmp plots
user@host: python -m toopazo_ulg.plot_main --bdir tests/
```

## How to update a new version to https://pypi.org/  

This is note to myself about the necessary steps to upload a new version 
of the code to the repo in https://pypi.org/.

I wrote a bash file to automate the update and uploading process to pypi. 
It is can be executed in the terminal using

```
. ./update_library.sh
```

The steps involved are taken from https://widdowquinn.github.io/coding/update-pypi-package/

1. Update local packages for distribution
    ```
    python3 -m pip install --user --upgrade setuptools wheel
    python3 -m pip install --user --upgrade twine 
    ```
2. Open setup.py and change the version, e.g., version='1.0.3'. 
   This can be done automatically by running 
   ```
   python increment_setup_version.py
   ```
3. It is sometimes neccessary to delete the build/ and dist/ folder
    ```
    rm -r build/*
    rm -r dist/*
    ```
4. Create distribution packages on your local machine, and check
the dist/ directory for the new version files
    ```
    python3 setup.py sdist bdist_wheel
    ```
5. Upload the distribution files to https://pypi.org/ server
    ```
    python3 -m twine upload dist/*
    ```
6. Install the package from https://pypi.org/ server
    ```
    python3 -m pip install -U toopazo-tools
    ```




%package help
Summary:	Development documents and examples for toopazo-ulg
Provides:	python3-toopazo-ulg-doc
%description help
# toopazo_ulg
This is the repository for the pip module ```https://pypi.org/project/toopazo-ulg/```

This is a simple python package that makes use of pyulog commands
(see https://github.com/PX4/pyulog ) to: parse, process and plot
Px4 .ulg log files ( see https://github.com/PX4/Firmware )


## How it works
It needs three folders: logs, tmp and plots (names are hardcoded).
It works by taking all .ulg files from the logs folder and then using
ulog2csv to writing the resulting .csv files in the tmp folder.
It finally writes all results in the plots folder.

## Dependencies
Install dependencies running pip as a module
```
 python3 -m pip install -U matplotlib
 python3 -m pip install -U numpy
 python3 -m pip install -U scipy
 python3 -m pip install -U toopazo_tools
```

## Usage
```
user@host: ls
logs tmp plots
user@host: python -m toopazo_ulg.plot_main --bdir tests/
```

## How to update a new version to https://pypi.org/  

This is note to myself about the necessary steps to upload a new version 
of the code to the repo in https://pypi.org/.

I wrote a bash file to automate the update and uploading process to pypi. 
It is can be executed in the terminal using

```
. ./update_library.sh
```

The steps involved are taken from https://widdowquinn.github.io/coding/update-pypi-package/

1. Update local packages for distribution
    ```
    python3 -m pip install --user --upgrade setuptools wheel
    python3 -m pip install --user --upgrade twine 
    ```
2. Open setup.py and change the version, e.g., version='1.0.3'. 
   This can be done automatically by running 
   ```
   python increment_setup_version.py
   ```
3. It is sometimes neccessary to delete the build/ and dist/ folder
    ```
    rm -r build/*
    rm -r dist/*
    ```
4. Create distribution packages on your local machine, and check
the dist/ directory for the new version files
    ```
    python3 setup.py sdist bdist_wheel
    ```
5. Upload the distribution files to https://pypi.org/ server
    ```
    python3 -m twine upload dist/*
    ```
6. Install the package from https://pypi.org/ server
    ```
    python3 -m pip install -U toopazo-tools
    ```




%prep
%autosetup -n toopazo-ulg-0.0.24

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-toopazo-ulg -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.24-1
- Package Spec generated