Skip to content

Commit

Permalink
Merge pull request #151 from MannLabs/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
jalew188 authored Apr 12, 2024
2 parents 8317f47 + dbb90be commit dc62088
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.1.7
current_version = 1.1.8
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release_installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,38 @@ jobs:
asset_path: release/one_click_macos_gui/dist/peptdeep_gui_installer_macos.pkg
asset_name: peptdeep_gui_installer_macos.pkg
asset_content_type: application/octet-stream
Create_MacOS_Arm_Release:
runs-on: macos-latest-xlarge
needs: Create_Draft_On_GitHub
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Creating installer for MacOS
shell: bash -l {0}
run: |
cd release/one_click_macos_gui
. ./create_installer_macos.sh
- name: Test installer for MacOS
shell: bash -l {0}
run: |
sudo installer -pkg release/one_click_macos_gui/dist/peptdeep_gui_installer_macos.pkg -target /
- name: Upload MacOS Installer
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.Create_Draft_On_GitHub.outputs.upload_url }}
asset_path: release/one_click_macos_gui/dist/peptdeep_gui_installer_macos.pkg
asset_name: peptdeep_gui_installer_macos_arm.pkg
asset_content_type: application/octet-stream
Create_Windows_Release:
runs-on: windows-latest
needs: Create_Draft_On_GitHub
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
copyright = '2022, Mann Labs, MPIB'
author = 'Mann Labs, MPIB'

release = "1.1.7"
release = "1.1.8"

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion peptdeep/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# pass

__project__ = "peptdeep"
__version__ = "1.1.7"
__version__ = "1.1.8"
__license__ = "Apache 2.0"
__description__ = "The AlphaX deep learning framework for Proteomics"
__author__ = "Mann Labs"
Expand Down
4 changes: 2 additions & 2 deletions peptdeep/model/building_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,10 @@ def forward(self,
):
mod_x = self.mod_nn(mod_x)
x = self.aa_emb(aa_indices)
charge_x = charges.unsqueeze(1).repeat(
charge_x = charges[:, None, None].repeat(
1, mod_x.size(1), self.charge_dim
)
return self.pos_encoder(torch.cat((x, mod_x,charge_x), 2))
return self.pos_encoder(torch.cat((x, mod_x, charge_x), 2))

class Input_26AA_Mod_LSTM(torch.nn.Module):
"""
Expand Down
12 changes: 9 additions & 3 deletions peptdeep/model/model_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ def _get_cosine_schedule_with_warmup_lr_lambda(
current_step: int, *, num_warmup_steps: int, num_training_steps: int, num_cycles: float
):
if current_step < num_warmup_steps:
return float(current_step) / float(max(1, num_warmup_steps))
progress = float(current_step - num_warmup_steps) / float(max(1, num_training_steps - num_warmup_steps))
return max(0.0, 0.5 * (1.0 + math.cos(math.pi * float(num_cycles) * 2.0 * progress)))
return float(current_step+1) / float(max(1, num_warmup_steps))
progress = float(current_step - num_warmup_steps) / float(num_training_steps - num_warmup_steps)
return (
max(1e-10, 0.5 * (1.0 + math.cos(math.pi * float(num_cycles) * 2.0 * progress)))
)
# if current_step < num_warmup_steps:
# return float(current_step) / float(max(1, num_warmup_steps))
# progress = float(current_step - num_warmup_steps) / float(max(1, num_training_steps - num_warmup_steps))
# return max(0.0, 0.5 * (1.0 + math.cos(math.pi * float(num_cycles) * 2.0 * progress)))


def get_cosine_schedule_with_warmup(
Expand Down
18 changes: 18 additions & 0 deletions peptdeep/utils/_pyinstaller_hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from transformers.dependency_versions_check import pkgs_to_check_at_runtime

def get_peptdeep_datas():
"""
Huggingface has some dependencies those are not included in pyinstaller,
so we need to add them manually.
Usages:
In pyinstaller's *.spec file, add `datas += get_peptdeep_datas()` before
`.. = Analysis(..., datas=datas,...)`.
"""
from PyInstaller.utils.hooks import copy_metadata
for _pkg in ["python","accelerate"]:
if _pkg in pkgs_to_check_at_runtime:
pkgs_to_check_at_runtime.remove(_pkg)
datas = []
for _pkg in pkgs_to_check_at_runtime:
datas += copy_metadata(_pkg)
return datas
2 changes: 1 addition & 1 deletion release/one_click_linux_gui/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: peptdeep
Version: 1.1.7
Version: 1.1.8
Architecture: all
Maintainer: Mann Labs <opensource@alphapept.com>
Description: peptdeep
Expand Down
2 changes: 1 addition & 1 deletion release/one_click_linux_gui/create_installer_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ python setup.py sdist bdist_wheel
# Setting up the local package
cd release/one_click_linux_gui
# Make sure you include the required extra packages and always use the stable or very-stable options!
pip install "../../dist/peptdeep-1.1.7-py3-none-any.whl[stable]"
pip install "../../dist/peptdeep-1.1.8-py3-none-any.whl[stable]"

if [ "$1" == "CPU" ]; then
pip install torch -U --extra-index-url https://download.pytorch.org/whl/cpu
Expand Down
4 changes: 2 additions & 2 deletions release/one_click_macos_gui/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<key>CFBundleIconFile</key>
<string>alpha_logo.icns</string>
<key>CFBundleIdentifier</key>
<string>peptdeep.1.1.7</string>
<string>peptdeep.1.1.8</string>
<key>CFBundleShortVersionString</key>
<string>1.1.7</string>
<string>1.1.8</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
4 changes: 2 additions & 2 deletions release/one_click_macos_gui/create_installer_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ python setup.py sdist bdist_wheel

# Setting up the local package
cd release/one_click_macos_gui
pip install "../../dist/peptdeep-1.1.7-py3-none-any.whl[stable]"
pip install "../../dist/peptdeep-1.1.8-py3-none-any.whl[stable]"

# Creating the stand-alone pyinstaller folder
pip install pyinstaller
Expand All @@ -40,5 +40,5 @@ cp ../../LICENSE.txt Resources/LICENSE.txt
cp ../logos/alpha_logo.png Resources/alpha_logo.png
chmod 777 scripts/*

pkgbuild --root dist/peptdeep --identifier de.mpg.biochem.peptdeep.app --version 1.1.7 --install-location /Applications/peptdeep.app --scripts scripts peptdeep.pkg
pkgbuild --root dist/peptdeep --identifier de.mpg.biochem.peptdeep.app --version 1.1.8 --install-location /Applications/peptdeep.app --scripts scripts peptdeep.pkg
productbuild --distribution distribution.xml --resources Resources --package-path peptdeep.pkg dist/peptdeep_gui_installer_macos.pkg
2 changes: 1 addition & 1 deletion release/one_click_macos_gui/distribution.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-script minSpecVersion="1.000000">
<title>peptdeep 1.1.7</title>
<title>peptdeep 1.1.8</title>
<background mime-type="image/png" file="alpha_logo.png" scaling="proportional"/>
<welcome file="welcome.html" mime-type="text/html" />
<conclusion file="conclusion.html" mime-type="text/html" />
Expand Down
2 changes: 1 addition & 1 deletion release/one_click_windows_gui/create_installer_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ python setup.py sdist bdist_wheel
# Setting up the local package
cd release/one_click_windows_gui
# Make sure you include the required extra packages and always use the stable or very-stable options!
pip install "../../dist/peptdeep-1.1.7-py3-none-any.whl[stable]"
pip install "../../dist/peptdeep-1.1.8-py3-none-any.whl[stable]"

# Creating the stand-alone pyinstaller folder
pip install pyinstaller
Expand Down
2 changes: 1 addition & 1 deletion release/one_click_windows_gui/peptdeep_innoinstaller.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "peptdeep"
#define MyAppVersion "1.1.7"
#define MyAppVersion "1.1.8"
#define MyAppPublisher "Max Planck Institute of Biochemistry and the University of Copenhagen, Mann Labs"
#define MyAppURL "https://github.com/MannLabs/peptdeep"
#define MyAppExeName "peptdeep_gui.exe"
Expand Down
7 changes: 2 additions & 5 deletions release/pyinstaller/peptdeep.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import pkg_resources
import importlib.metadata
from transformers.dependency_versions_check import pkgs_to_check_at_runtime
import peptdeep
from peptdeep.utils._pyinstaller_hooks import get_peptdeep_datas


##################### User definitions
Expand Down Expand Up @@ -92,11 +93,7 @@ datas = [d for d in datas if ("__pycache__" not in d[0]) and (d[1] not in [".",
# if not os.path.exists(libssl_dll_path):
# datas.append((libssl_lib_path, "."))

for _pkg in ["python","accelerate"]:
if _pkg in pkgs_to_check_at_runtime:
pkgs_to_check_at_runtime.remove(_pkg)
for _pkg in pkgs_to_check_at_runtime:
datas += copy_metadata(_pkg)
datas += get_peptdeep_datas()

gui_a = Analysis(
[gui_script],
Expand Down
2 changes: 1 addition & 1 deletion settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Python library ###
repo = alphapeptdeep
lib_name = peptdeep
version = 1.1.7
version = 1.1.8
min_python = 3.7
license = apache2

Expand Down

0 comments on commit dc62088

Please sign in to comment.