Skip to content
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
33 changes: 26 additions & 7 deletions .github/workflows/Distribute_Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,47 @@ jobs:
- name: Get version from tag
run: echo "VERSION=${{ github.ref_name }}" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Debug VERSION
run: echo "VERSION=$env:VERSION"
# CLI build

- name: Replace version in setup.py
run: |
(Get-Content setup.py) -replace '__VERSION__', "$env:VERSION" | Set-Content setup.py

- name: Build with cx_Freeze
- name: Build CLI with cx_Freeze
run: |
python setup.py build

- name: Rename build output
- name: Rename CLI build output
run: |
Move-Item build\PPSD_Plotter_Windows ("build\PPSD_Plotter_" + $env:VERSION + "_Windows")

- name: Create distribution archive
- name: Create CLI distribution archive
run: |
Compress-Archive -Path ("build\PPSD_Plotter_" + $env:VERSION + "_Windows") -DestinationPath ("PPSD_Plotter_" + $env:VERSION + "_Windows.zip")

# Gui build

- name: Replace version in setup_gui.py
run: |
(Get-Content setup_gui.py) -replace '__VERSION__', "$env:VERSION" | Set-Content setup_gui.py

- name: Build GUI with cx_Freeze
run: |
python setup_gui.py build

- name: Rename GUI build output
run: |
Move-Item build\PPSD_Plotter_Windows_GUI ("build\PPSD_Plotter_" + $env:VERSION + "_Windows_GUI")

- name: Create GUI distribution archive
run: |
Compress-Archive -Path ("build\PPSD_Plotter_" + $env:VERSION + "_Windows_GUI") -DestinationPath ("PPSD_Plotter_" + $env:VERSION + "_Windows_GUI.zip")

- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: PPSD_Plotter_${{ github.ref_name }}_Windows.zip
files: |
PPSD_Plotter_${{ github.ref_name }}_Windows.zip
PPSD_Plotter_${{ github.ref_name }}_Windows_GUI.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions example/example_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ datasets:
action: full
output_folder: "example/result"
figsize: [6, 6]
show_mean: yes
grid: no
show_mean: true
grid: true
39 changes: 39 additions & 0 deletions example/example_config_GUI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
datasets:
- action: full
channels:
- 00.BH1
- 00.BH2
- 00.BHZ
folder: example/IU.ANMO..D
plot_kwargs:
cmap: pqlx
cumulative: false
grid: true
show_coverage: true
show_histogram: true
show_mean: false
show_mode: false
show_noise_models: true
show_percentiles: false
xaxis_frequency: false
response: example/IU_ANMO_RESP.xml
timewindow: 600
- action: full
channels:
- 00.BH1
- 00.BH2
- 00.BHZ
folder: example/IU.GRFO..D
plot_kwargs:
cmap: pqlx
cumulative: false
grid: true
show_coverage: true
show_histogram: true
show_mean: true
show_mode: false
show_noise_models: true
show_percentiles: false
xaxis_frequency: false
response: example/IU_GRFO_RESP.xml
timewindow: 600
Binary file added resources/icon.ico
Binary file not shown.
46 changes: 46 additions & 0 deletions setup_gui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from cx_Freeze import setup, Executable
import sys
import os
from pathlib import Path
import matplotlib
import obspy

mpl_data_path = matplotlib.get_data_path()
sys.setrecursionlimit(8000)

obsipy_data_dir = os.path.join(
os.path.dirname(obspy.__file__), "imaging", "data"
)

site_packages = next(p for p in sys.path if 'site-packages' in p)
dist_info = next(Path(site_packages).glob("obspy-*.dist-info"))

exe = Executable(
script=os.path.join("src", "gui.py"),
base=None if sys.platform == "win32" else None,
target_name="PPSD_Plot_GUI",
icon="resources/icon.ico"
)

setup(
name="PPSD_Plotter",
version="__VERSION__",
description="A simple PPSD plotting tool based on ObsPy",
options={
"build_exe": {
"packages": ["obspy", "matplotlib", "yaml", "numpy",
"tqdm", "os", "pathlib"],
"excludes": [],
"include_files": [
(str(dist_info), f"lib/{dist_info.name}"),
(mpl_data_path, "lib/matplotlib/mpl-data"),
(obsipy_data_dir, "lib/obspy/imaging/data"),
("example", "example"),
("LICENSE", "LICENSE"),
("resources/icon.ico", "resources/icon.ico"),
],
"build_exe": "build/PPSD_Plotter_Windows_GUI"
}
},
executables=[exe],
)
Loading
Loading