Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
71491a4
fix out of scope readme
z3rone Jun 26, 2026
cb198a3
darwin compatibility and more explicit skipping
z3rone Jun 26, 2026
d2945b3
format
z3rone Jun 26, 2026
7d3355e
linting
z3rone Jun 26, 2026
a83be21
stricter linting
z3rone Jun 26, 2026
6f6dba4
linting
z3rone Jun 26, 2026
74d9298
implement collision energy
z3rone Jun 26, 2026
f0df8be
implement isolation
z3rone Jun 26, 2026
0116c6f
add new rawfile to test
z3rone Jun 26, 2026
832c506
more tests
z3rone Jun 26, 2026
d51c420
Merge pull request #6 from z3rone-org/fix/macos-tests
z3rone Jun 26, 2026
7a809fa
style: enforce multi-line blocks with .editorconfig and dotnet format
z3rone Jun 26, 2026
9ce77cd
linting and precursor range test
z3rone Jun 26, 2026
0d7286a
test prec mass range
z3rone Jun 26, 2026
9379c4f
draft scan stats
z3rone Jun 27, 2026
6c01615
Add test_scan_stats.py
z3rone Jun 27, 2026
acf55ff
refactor
z3rone Jun 27, 2026
f895896
read and test headers
z3rone Jun 27, 2026
9ee9db1
improve tests
z3rone Jun 27, 2026
ca8a144
add test files
z3rone Jun 27, 2026
ac0e159
proper failing
z3rone Jun 27, 2026
1154355
improve logging
z3rone Jun 29, 2026
8881543
linting and new properties
z3rone Jun 29, 2026
bd3b662
better catch
z3rone Jun 29, 2026
0bce8e3
linting
z3rone Jun 29, 2026
2ad266d
linting
z3rone Jun 29, 2026
5905a78
test new file
z3rone Jun 29, 2026
c3cc21e
test scan deps
z3rone Jun 29, 2026
86087ed
Delete AI comment
z3rone Jun 29, 2026
5e78d43
lint
z3rone Jun 29, 2026
02eca0d
read scan filters
z3rone Jun 29, 2026
dadf898
read error log
z3rone Jun 29, 2026
49d43a5
draft sample info reading
z3rone Jun 29, 2026
058733b
read sample info
z3rone Jun 29, 2026
0f6fb52
with block support
z3rone Jun 30, 2026
0fd55e6
fix enum parity
z3rone Jun 30, 2026
fbca69a
fix type infer exception
z3rone Jun 30, 2026
890e014
fix errors
z3rone Jun 30, 2026
33355f0
cleanup
z3rone Jun 30, 2026
5ca9c17
remove useless test
z3rone Jun 30, 2026
f121e88
remove brokem import
z3rone Jul 1, 2026
232ea64
even further broaden localization
z3rone Jul 1, 2026
9c3859c
even further broaden localization
z3rone Jul 1, 2026
3f33820
fix date
z3rone Jul 1, 2026
e842bca
Merge pull request #7 from z3rone-org/feature/missing-features
z3rone Jul 1, 2026
6ae98d9
change versioning mechanism
z3rone Jul 1, 2026
a583bca
bump version
z3rone Jul 1, 2026
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
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 160
extend-ignore = E203, W503, E501, E722, F403, F405, E741, F811, F401
48 changes: 24 additions & 24 deletions .github/patch_fisher_py.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import re
import site
import sys

Expand All @@ -8,14 +7,11 @@ def get_fisher_py_path():
path = os.path.join(site_pkg, 'fisher_py')
if os.path.exists(path):
return path

# Also check virtual environments where site.getsitepackages() might be missing
for p in sys.path:
path = os.path.join(p, 'fisher_py')
if os.path.exists(path):
return path

raise RuntimeError("fisher_py not found in sys.path or site-packages")
raise RuntimeError("fisher_py not found")

def patch_fisher_py():
try:
Expand All @@ -25,34 +21,38 @@ def patch_fisher_py():
with open(init_file, 'r') as f:
content = f.read()

# Add import sys if needed
if "import sys" not in content:
content = "import sys\n" + content

# Ensure sys.path.append(dll_path) is added
if "sys.path.append(os.path.realpath(dll_path))" not in content:
content = content.replace("clr.AddReference('mscorlib')", "clr.AddReference('mscorlib')\nsys.path.append(os.path.realpath(dll_path))")
if "from System.Reflection import Assembly" not in content:
content = content.replace("from System import Environment", "from System import Environment\nfrom System.Reflection import Assembly")

import re

# Add helper function at the top of the file after imports
helper = """
def _safe_load_assembly(path):
try:
Assembly.LoadFrom(path)
except Exception:
pass
"""
if "_safe_load_assembly" not in content:
content = content.replace("import os", "import os\n" + helper, 1)

def replacer(match):
original = match.group(1)
return f"_safe_load_assembly(os.path.realpath({original}))"

# Replace clr.AddReference(os.path.join(dll_path, 'AssemblyName.dll'))
# with clr.AddReference('AssemblyName')
content = re.sub(
r"clr\.AddReference\((?:os\.path\.join\()?dll_path,\s*'([^']+)\.dll'(?:\))?\)",
r"clr.AddReference('\1')",
content
)
# Also clean up any lingering Assembly.LoadFrom from previous patches just in case
content = re.sub(
r"Assembly\.LoadFrom\(os\.path\.realpath\(os\.path\.join\(dll_path,\s*'([^']+)\.dll'\)\)\)",
r"clr.AddReference('\1')",
r"clr\.AddReference\((os\.path\.join\(dll_path,\s*'[^']+'\))\)",
replacer,
content
)

with open(init_file, 'w') as f:
f.write(content)

print(f"Successfully patched {init_file}")
except Exception as e:
print(f"Failed to patch fisher_py: {e}")
print(f"Failed to patch: {e}")
sys.exit(1)

if __name__ == '__main__':
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ jobs:
with:
submodules: recursive

- name: Set version from tag
- name: Verify version matches tag
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
echo "Updating version in Cargo.toml to $TAG_VERSION"
if [[ "${{ runner.os }}" == "macOS" ]]; then
sed -i '' 's/^version = ".*"/version = "'$TAG_VERSION'"/' native_fisher_py/Cargo.toml
else
sed -i 's/^version = ".*"/version = "'$TAG_VERSION'"/' native_fisher_py/Cargo.toml
# Extract version from Cargo.toml
CARGO_VERSION=$(grep -m1 '^version =' native_fisher_py/Cargo.toml | cut -d '"' -f 2)
echo "Tag version: $TAG_VERSION"
echo "Cargo version: $CARGO_VERSION"
if [[ "$TAG_VERSION" != "$CARGO_VERSION" ]]; then
echo "Error: Tag version ($TAG_VERSION) does not match Cargo.toml version ($CARGO_VERSION)"
exit 1
fi

- name: Install NativeAOT Dependencies (Linux)
Expand Down Expand Up @@ -75,6 +77,9 @@ jobs:
with:
python-version: '3.9'

- name: Copy README
run: cp README.md native_fisher_py/

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,22 @@ maturin develop
This project is powered by the [**Thermo Fisher Scientific RawFileReader**](https://github.com/thermofisherlsms/RawFileReader) (copyright © 2016-2026 Thermo Fisher Scientific, Inc.). All rights reserved.

The `native-fisher-py` package includes the official RawFileReader libraries, which remain the property of Thermo Fisher Scientific. By using this software, you agree to the terms specified in their [license](https://github.com/thermofisherlsms/RawFileReader/blob/main/License.doc).

## Releasing a New Version
Releases are fully automated via GitHub Actions (`release.yml`), but the workflow **requires** that the git tag strictly matches the version in `native_fisher_py/Cargo.toml`.

To trigger a new release and publish to PyPI:

1. Update the version in `native_fisher_py/Cargo.toml`.
2. Commit the version bump.
3. Create and push a matching git tag:

```bash
git tag vX.Y.Z
git push origin vX.Y.Z
```

The GitHub Action will automatically:
1. Verify that the git tag version matches the `Cargo.toml` version (failing otherwise).
2. Build the native wheels across all platforms (macOS, Linux, Windows).
3. Publish the final artifacts to PyPI.
17 changes: 17 additions & 0 deletions native/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*.cs]
# Disable preserving single-line blocks and statements
csharp_preserve_single_line_blocks = false
csharp_preserve_single_line_statements = false

# Newline settings for braces
csharp_new_line_before_open_brace = all
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true

# General formatting
insert_final_newline = true
indent_style = space
indent_size = 4
Loading
Loading