Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cf4275c363 |
@@ -9,17 +9,14 @@ on:
|
||||
jobs:
|
||||
macos:
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python_version: ['3.7', '3.8', '3.9', '3.10', '3.11']
|
||||
steps:
|
||||
- name: Checkout project
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Python setup
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
python-version: 3.9
|
||||
architecture: x64
|
||||
|
||||
- name: Rust setup
|
||||
@@ -30,10 +27,10 @@ jobs:
|
||||
default: true
|
||||
|
||||
- name: Build wheels - x86_64
|
||||
uses: PyO3/maturin-action@v1
|
||||
uses: messense/maturin-action@v1
|
||||
with:
|
||||
target: x86_64
|
||||
args: --release --out dist --sdist
|
||||
args: --release --out dist
|
||||
|
||||
- name: Install built wheel - x86_64
|
||||
run: |
|
||||
@@ -41,9 +38,9 @@ jobs:
|
||||
python -c "import akatsuki_pp_py"
|
||||
|
||||
- name: Build wheels - universal2
|
||||
uses: PyO3/maturin-action@v1
|
||||
uses: messense/maturin-action@v1
|
||||
with:
|
||||
args: --release --universal2 --out dist
|
||||
args: --release --universal2 --out dist --no-sdist
|
||||
|
||||
- name: Install built wheel - universal2
|
||||
run: |
|
||||
@@ -60,16 +57,15 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python_version: ['3.7', '3.8', '3.9', '3.10', '3.11']
|
||||
target: [x64, x86]
|
||||
steps:
|
||||
- name: Checkout project
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Python setup
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
python-version: 3.9
|
||||
architecture: ${{ matrix.target }}
|
||||
|
||||
- name: Rust setup
|
||||
@@ -80,10 +76,10 @@ jobs:
|
||||
default: true
|
||||
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@v1
|
||||
uses: messense/maturin-action@v1
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
args: --release --out dist
|
||||
args: --release --out dist --no-sdist
|
||||
|
||||
- name: Install built wheel
|
||||
run: |
|
||||
@@ -97,27 +93,26 @@ jobs:
|
||||
path: dist
|
||||
|
||||
linux:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python_version: ['3.7', '3.8', '3.9', '3.10', '3.11']
|
||||
target: [x86_64, i686]
|
||||
steps:
|
||||
- name: Checkout project
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Python setup
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
python-version: 3.9
|
||||
architecture: x64
|
||||
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@v1
|
||||
uses: messense/maturin-action@v1
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
manylinux: auto
|
||||
args: --release --out dist -i ${{ matrix.python_version }}
|
||||
args: --release --out dist --no-sdist
|
||||
|
||||
- name: Install built wheel
|
||||
if: matrix.target == 'x86_64'
|
||||
@@ -134,9 +129,6 @@ jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python_version: ['3.7', '3.8', '3.9', '3.10', '3.11']
|
||||
needs: [ macos, windows, linux ]
|
||||
steps:
|
||||
- name: Get artifacts
|
||||
@@ -147,7 +139,7 @@ jobs:
|
||||
- name: Python setup
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
python-version: 3.9
|
||||
|
||||
- name: Publish to PyPi
|
||||
env:
|
||||
|
||||
Generated
+3
-3
@@ -4,12 +4,12 @@ version = 3
|
||||
|
||||
[[package]]
|
||||
name = "akatsuki-pp"
|
||||
version = "0.9.4"
|
||||
source = "git+https://github.com/osuAkatsuki/akatsuki-pp-rs?rev=764da0dbf42ed80441acf99d070aaedabaed4b75#764da0dbf42ed80441acf99d070aaedabaed4b75"
|
||||
version = "0.9.3"
|
||||
source = "git+https://github.com/osuAkatsuki/akatsuki-pp-rs#4140dc70840044d9d4313731ce04c5793098ed62"
|
||||
|
||||
[[package]]
|
||||
name = "akatsuki-pp-py"
|
||||
version = "0.9.4"
|
||||
version = "0.9.3"
|
||||
dependencies = [
|
||||
"akatsuki-pp",
|
||||
"pyo3",
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "akatsuki-pp-py"
|
||||
version = "0.9.5"
|
||||
version = "0.9.3"
|
||||
description = "osu! difficulty and pp calculation for all modes"
|
||||
authors = ["Max Ohn <ohn.m@hotmail.de>", "tsunyoku <tsunyoku@gmail.com>"]
|
||||
license = "MIT"
|
||||
@@ -12,7 +12,7 @@ crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
pyo3 = { version = "0.17", features = ["extension-module", "macros"] }
|
||||
akatsuki-pp = { git = "https://github.com/osuAkatsuki/akatsuki-pp-rs", rev = "764da0dbf42ed80441acf99d070aaedabaed4b75" }
|
||||
akatsuki-pp = { git = "https://github.com/osuAkatsuki/akatsuki-pp-rs", rev = "61cb1564b4fdbffb21748b35f58805327dc4aac4" }
|
||||
|
||||
[profile.release]
|
||||
lto = "fat"
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
[build-system]
|
||||
requires = ["maturin>=0.14,<0.15"]
|
||||
requires = ["maturin>=0.12,<0.13", "setuptools", "setuptools-rust", "wheel"]
|
||||
build-backend = "maturin"
|
||||
|
||||
[project]
|
||||
name = "akatsuki-pp-py"
|
||||
version = "0.9.5"
|
||||
version = "0.9.3"
|
||||
requires-python = ">=3.7"
|
||||
description = "osu! difficulty and pp calculation for all modes"
|
||||
classifiers = [
|
||||
|
||||
+1
-65
@@ -1,8 +1,4 @@
|
||||
use akatsuki_pp::{
|
||||
osu::{OsuDifficultyAttributes, OsuPerformanceAttributes},
|
||||
osu_2019::OsuPP,
|
||||
AnyPP, AnyStars, DifficultyAttributes, GameMode, Mods, PerformanceAttributes,
|
||||
};
|
||||
use akatsuki_pp::{AnyPP, AnyStars, DifficultyAttributes, GameMode};
|
||||
use pyo3::{
|
||||
exceptions::{PyTypeError, PyValueError},
|
||||
pyclass, pymethods,
|
||||
@@ -231,67 +227,7 @@ impl PyCalculator {
|
||||
Ok(calc.calculate().into())
|
||||
}
|
||||
|
||||
fn performance_2019(&self, map: &PyBeatmap) -> PyResult<PyPerformanceAttributes> {
|
||||
let mut calc = OsuPP::new(&map.inner);
|
||||
|
||||
set_calc! { calc, self:
|
||||
mods,
|
||||
combo,
|
||||
n300,
|
||||
n100,
|
||||
n50,
|
||||
passed_objects,
|
||||
};
|
||||
|
||||
if let Some(n_misses) = self.n_misses {
|
||||
calc = calc.misses(n_misses);
|
||||
}
|
||||
|
||||
if let Some(acc) = self.acc {
|
||||
calc = calc.accuracy(acc as f32);
|
||||
}
|
||||
|
||||
let attrs = calc.calculate();
|
||||
|
||||
let new_attrs = OsuPerformanceAttributes {
|
||||
difficulty: OsuDifficultyAttributes {
|
||||
aim: attrs.difficulty.aim_strain,
|
||||
speed: attrs.difficulty.speed_strain,
|
||||
flashlight: 0.0,
|
||||
slider_factor: 0.0,
|
||||
speed_note_count: 0.0,
|
||||
ar: attrs.difficulty.ar,
|
||||
od: attrs.difficulty.od,
|
||||
hp: attrs.difficulty.hp,
|
||||
n_circles: attrs.difficulty.n_circles,
|
||||
n_sliders: attrs.difficulty.n_sliders,
|
||||
n_spinners: attrs.difficulty.n_spinners,
|
||||
stars: attrs.difficulty.stars,
|
||||
max_combo: attrs.difficulty.max_combo,
|
||||
},
|
||||
pp: attrs.pp,
|
||||
pp_acc: attrs.pp_acc,
|
||||
pp_aim: attrs.pp_aim,
|
||||
pp_flashlight: attrs.pp_flashlight,
|
||||
pp_speed: attrs.pp_speed,
|
||||
effective_miss_count: attrs.effective_miss_count,
|
||||
};
|
||||
|
||||
Ok(PerformanceAttributes::Osu(new_attrs).into())
|
||||
}
|
||||
|
||||
fn performance(&self, map: &PyBeatmap) -> PyResult<PyPerformanceAttributes> {
|
||||
// criteria:
|
||||
// - is relax
|
||||
// - is osu!standard
|
||||
// or mode is not specified and map is osu!standard, as that will be the inferred mode
|
||||
if (self.mods.is_some() && self.mods.unwrap().rx())
|
||||
&& ((self.mode.is_none() && map.inner.mode == GameMode::Osu)
|
||||
|| self.mode == Some(GameMode::Osu))
|
||||
{
|
||||
return self.performance_2019(map);
|
||||
}
|
||||
|
||||
let mut calc = AnyPP::new(&map.inner);
|
||||
|
||||
set_calc! { calc, self:
|
||||
|
||||
+5
-1
@@ -1,10 +1,10 @@
|
||||
use std::fmt::{Debug, Display, Formatter, Result as FmtResult};
|
||||
|
||||
use pyo3::{pyclass, pymethods};
|
||||
use akatsuki_pp::{
|
||||
catch::CatchDifficultyAttributes, mania::ManiaDifficultyAttributes,
|
||||
osu::OsuDifficultyAttributes, taiko::TaikoDifficultyAttributes, DifficultyAttributes,
|
||||
};
|
||||
use pyo3::{pyclass, pymethods};
|
||||
|
||||
#[pyclass(name = "DifficultyAttributes")]
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -91,6 +91,8 @@ impl Debug for BorrowedDifficultyAttributes<'_> {
|
||||
n_spinners,
|
||||
stars,
|
||||
max_combo,
|
||||
aim_difficult_strain_count,
|
||||
speed_difficult_strain_count,
|
||||
} = attrs;
|
||||
|
||||
debug.field("mode", &0_u8);
|
||||
@@ -109,6 +111,8 @@ impl Debug for BorrowedDifficultyAttributes<'_> {
|
||||
n_spinners,
|
||||
stars,
|
||||
max_combo,
|
||||
aim_difficult_strain_count,
|
||||
speed_difficult_strain_count,
|
||||
}
|
||||
}
|
||||
Self::Taiko(attrs) => {
|
||||
|
||||
Reference in New Issue
Block a user