diff --git a/python/roman-numerals/.coverage.xml b/python/roman-numerals/.coverage.xml index 7db84222..8bdf9170 100644 --- a/python/roman-numerals/.coverage.xml +++ b/python/roman-numerals/.coverage.xml @@ -1,5 +1,5 @@ - + diff --git a/python/roman-numerals/roman_numerals.py b/python/roman-numerals/roman_numerals.py index 0f3a69f5..87ee92ce 100644 --- a/python/roman-numerals/roman_numerals.py +++ b/python/roman-numerals/roman_numerals.py @@ -2,15 +2,15 @@ from collections import OrderedDict -type modern_numeral_t = int # type: ignore[valid-type] -type roman_numeral_t = str # type: ignore[valid-type] -type map_d2r_t = OrderedDict[modern_numeral_t, roman_numeral_t] # type: ignore[valid-type] +ModernNumeralT = int +RomanNumeralT = str +MapD2RT = OrderedDict[ModernNumeralT, RomanNumeralT] -def roman(number: modern_numeral_t) -> roman_numeral_t: - rn: roman_numeral_t = "" +def roman(number: ModernNumeralT) -> RomanNumeralT: + rn: RomanNumeralT = "" - d2r: map_d2r_t = OrderedDict() + d2r: MapD2RT = OrderedDict() d2r[1] = "I" d2r[4] = "IV" d2r[5] = "V" diff --git a/python/roman-numerals/roman_numerals.py,cover b/python/roman-numerals/roman_numerals.py,cover index a21910e6..2e1da3d6 100644 --- a/python/roman-numerals/roman_numerals.py,cover +++ b/python/roman-numerals/roman_numerals.py,cover @@ -2,15 +2,15 @@ > from collections import OrderedDict -> type modern_numeral_t = int # type: ignore[valid-type] -> type roman_numeral_t = str # type: ignore[valid-type] -> type map_d2r_t = OrderedDict[modern_numeral_t, roman_numeral_t] # type: ignore[valid-type] +> ModernNumeralT = int +> RomanNumeralT = str +> MapD2RT = OrderedDict[ModernNumeralT, RomanNumeralT] -> def roman(number: modern_numeral_t) -> roman_numeral_t: -> rn: roman_numeral_t = "" +> def roman(number: ModernNumeralT) -> RomanNumeralT: +> rn: RomanNumeralT = "" -> d2r: map_d2r_t = OrderedDict() +> d2r: MapD2RT = OrderedDict() > d2r[1] = "I" > d2r[4] = "IV" > d2r[5] = "V" diff --git a/python/roman-numerals/run-tests-python.txt b/python/roman-numerals/run-tests-python.txt index c6208626..003f6b9a 100644 --- a/python/roman-numerals/run-tests-python.txt +++ b/python/roman-numerals/run-tests-python.txt @@ -23,9 +23,9 @@ pylint 3.0.3 astroid 3.0.2 Python 3.12.1 (main, Dec 28 2023, 08:22:05) [GCC 10.2.1 20210110] -real 0m0.221s -user 0m0.162s -sys 0m0.062s +real 0m0.234s +user 0m0.156s +sys 0m0.080s ============================================================================== @@ -36,25 +36,25 @@ Running: pylint ./src src/roman_numerals/roman_numerals.py:10:0: C0116: Missing function or method docstring (missing-function-docstring) ------------------------------------------------------------------ -Your code has been rated at 9.60/10 (previous run: 9.62/10, -0.02) +Your code has been rated at 9.60/10 (previous run: 9.60/10, +0.00) -real 0m0.579s -user 0m0.490s -sys 0m0.091s +real 0m0.558s +user 0m0.483s +sys 0m0.078s ============================================================================== Exit code: -1 -real 0m1.712s -user 0m1.296s -sys 0m0.440s +real 0m1.732s +user 0m1.304s +sys 0m0.454s -real 0m1.716s -user 0m1.296s -sys 0m0.444s +real 0m1.736s +user 0m1.307s +sys 0m0.455s =============================================================================== @@ -76,9 +76,9 @@ Running: ruff --version ruff 0.3.5 -real 0m0.079s -user 0m0.030s -sys 0m0.051s +real 0m0.077s +user 0m0.028s +sys 0m0.052s ============================================================================== @@ -87,22 +87,22 @@ Running: ruff check --ignore E501 ./src All checks passed! -real 0m0.097s -user 0m0.040s -sys 0m0.061s +real 0m0.114s +user 0m0.045s +sys 0m0.073s ============================================================================== Exit code: 0 -real 0m1.096s -user 0m0.727s -sys 0m0.395s +real 0m1.063s +user 0m0.700s +sys 0m0.387s -real 0m1.098s -user 0m0.728s -sys 0m0.396s +real 0m1.064s +user 0m0.700s +sys 0m0.389s =============================================================================== @@ -124,9 +124,9 @@ Running: pyright --version pyright 1.1.358 -real 0m1.021s -user 0m0.504s -sys 0m0.132s +real 0m0.690s +user 0m0.509s +sys 0m0.104s ============================================================================== @@ -136,7 +136,7 @@ Running: pyright --stats ./src Found 2 source files pyright 1.1.358 0 errors, 0 warnings, 0 informations -Completed in 0.617sec +Completed in 0.589sec Analysis stats Total files parsed and bound: 20 @@ -145,29 +145,29 @@ Total files checked: 2 Timing stats Find Source Files: 0sec Read Source Files: 0.01sec -Tokenize: 0.05sec -Parse: 0.05sec -Resolve Imports: 0.05sec +Tokenize: 0.04sec +Parse: 0.04sec +Resolve Imports: 0.06sec Bind: 0.05sec -Check: 0.09sec +Check: 0.08sec Detect Cycles: 0sec -real 0m1.250s -user 0m1.352s -sys 0m0.177s +real 0m1.197s +user 0m1.195s +sys 0m0.178s ============================================================================== Exit code: 0 -real 0m3.209s -user 0m2.501s -sys 0m0.620s +real 0m2.802s +user 0m2.341s +sys 0m0.578s -real 0m3.212s -user 0m2.504s -sys 0m0.620s +real 0m2.805s +user 0m2.343s +sys 0m0.579s =============================================================================== @@ -190,9 +190,9 @@ Running: bandit --version bandit 1.7.7 python version = 3.12.1 (main, Dec 28 2023, 08:22:05) [GCC 10.2.1 20210110] -real 0m0.269s -user 0m0.215s -sys 0m0.056s +real 0m0.288s +user 0m0.217s +sys 0m0.074s ============================================================================== @@ -204,7 +204,7 @@ Running: bandit --verbose --recursive ./src [main] INFO cli include tests: None [main] INFO cli exclude tests: None [main] INFO running on Python 3.12.1 -Run started:2024-04-13 15:41:59.990562 +Run started:2024-04-13 15:45:52.589695 Files in scope (2): ./src/roman_numerals/__init__.py (score: {SEVERITY: 0, CONFIDENCE: 0}) ./src/roman_numerals/roman_numerals.py (score: {SEVERITY: 0, CONFIDENCE: 0}) @@ -233,22 +233,22 @@ Run metrics: High: 0 Files skipped (0): -real 0m0.240s -user 0m0.160s -sys 0m0.082s +real 0m0.212s +user 0m0.151s +sys 0m0.062s ============================================================================== Exit code: 0 -real 0m1.395s -user 0m1.024s -sys 0m0.391s +real 0m1.391s +user 0m1.004s +sys 0m0.406s -real 0m1.397s -user 0m1.026s -sys 0m0.391s +real 0m1.394s +user 0m1.006s +sys 0m0.406s =============================================================================== @@ -271,9 +271,9 @@ Running: refurb --version Refurb: v1.26.0 Mypy: v1.9.0 -real 0m0.179s -user 0m0.120s -sys 0m0.061s +real 0m0.205s +user 0m0.131s +sys 0m0.077s ============================================================================== @@ -281,22 +281,22 @@ sys 0m0.061s Running: refurb --quiet --ignore 183 ./src -real 0m1.133s -user 0m1.037s -sys 0m0.098s +real 0m1.065s +user 0m0.970s +sys 0m0.097s ============================================================================== Exit code: 0 -real 0m3.311s -user 0m2.832s -sys 0m0.502s +real 0m3.255s +user 0m2.727s +sys 0m0.552s -real 0m3.313s -user 0m2.833s -sys 0m0.502s +real 0m3.258s +user 0m2.728s +sys 0m0.553s =============================================================================== @@ -332,22 +332,22 @@ Test passed. 0 passed and 0 failed. Test passed. -real 0m0.133s -user 0m0.083s -sys 0m0.053s +real 0m0.137s +user 0m0.077s +sys 0m0.062s ============================================================================== Exit code: 0 -real 0m1.041s -user 0m0.725s -sys 0m0.334s +real 0m1.060s +user 0m0.707s +sys 0m0.375s -real 0m1.043s -user 0m0.725s -sys 0m0.336s +real 0m1.062s +user 0m0.709s +sys 0m0.375s =============================================================================== @@ -379,9 +379,9 @@ Running: pytest --version pytest 7.4.3 -real 0m0.771s -user 0m0.842s -sys 0m0.821s +real 0m0.795s +user 0m0.793s +sys 0m0.855s ============================================================================== @@ -444,11 +444,11 @@ test/__init__.py 0 0 0 0 100% TOTAL 26 1 4 0 97% Coverage XML written to file .coverage.xml -======================== 26 passed, 1 warning in 0.96s ========================= +======================== 26 passed, 1 warning in 1.00s ========================= -real 0m1.803s -user 0m1.682s -sys 0m0.122s +real 0m1.859s +user 0m1.717s +sys 0m0.144s ============================================================================== @@ -462,9 +462,9 @@ test/__init__.py 0 0 0 0 100% --------------------------------------------------------------- TOTAL 26 1 4 0 97% -real 0m0.145s -user 0m0.094s -sys 0m0.053s +real 0m0.127s +user 0m0.084s +sys 0m0.044s ============================================================================== @@ -472,9 +472,9 @@ sys 0m0.053s Running: coverage annotate -real 0m0.163s -user 0m0.093s -sys 0m0.073s +real 0m0.151s +user 0m0.090s +sys 0m0.064s ============================================================================== @@ -486,28 +486,28 @@ Branch Coverage: 100.0% Exit code: 0 -real 0m3.836s -user 0m3.387s -sys 0m1.366s +real 0m3.844s +user 0m3.310s +sys 0m1.408s -real 0m3.838s -user 0m3.388s -sys 0m1.367s +real 0m3.846s +user 0m3.310s +sys 0m1.410s =============================================================================== tail -n 10000 ./*,cover | grep -E -C 3 '^> def |^! ' -> def roman(number: modern_numeral_t) -> roman_numeral_t: -> rn: roman_numeral_t = "" +> def roman(number: ModernNumeralT) -> RomanNumeralT: +> rn: RomanNumeralT = "" =============================================================================== Running: misspell ./src/roman_numerals/__init__.py ./src/roman_numerals/roman_numerals.py -real 0m0.018s -user 0m0.024s -sys 0m0.008s +real 0m0.025s +user 0m0.030s +sys 0m0.009s ===============================================================================