mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
Merge branch 'master' into master
This commit is contained in:
2
.github/workflows/python-publish.yml
vendored
2
.github/workflows/python-publish.yml
vendored
@@ -1,5 +1,5 @@
|
|||||||
# This workflows will upload a Python Package using Twine when a release is created
|
# This workflows will upload a Python Package using Twine when a release is created
|
||||||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
# For more information see https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
||||||
|
|
||||||
name: Upload Python Package
|
name: Upload Python Package
|
||||||
|
|
||||||
|
|||||||
17
.github/workflows/tests.yaml
vendored
17
.github/workflows/tests.yaml
vendored
@@ -9,15 +9,26 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
- name: Install dependencies
|
|
||||||
|
- uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/.cache/pip
|
||||||
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/dev-requirements.txt') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pip-
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
python -m pip install -U pip
|
pip install -r dev-requirements.txt
|
||||||
python -m pip install -r dev-requirements.txt
|
|
||||||
- name: Linter
|
- name: Linter
|
||||||
run: make lint
|
run: make lint
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: make test
|
run: make test
|
||||||
|
|||||||
@@ -4,3 +4,4 @@ flake8
|
|||||||
autopep8
|
autopep8
|
||||||
sympy
|
sympy
|
||||||
numpy
|
numpy
|
||||||
|
scipy
|
||||||
|
|||||||
@@ -94,4 +94,5 @@ from .degree_to_rad import *
|
|||||||
from .radian_to_deg import *
|
from .radian_to_deg import *
|
||||||
from .differentiation import *
|
from .differentiation import *
|
||||||
from .definite_integral import *
|
from .definite_integral import *
|
||||||
|
from .is_prime import *
|
||||||
from .curvedSurfaceAreaCylinderFunc import *
|
from .curvedSurfaceAreaCylinderFunc import *
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ def decimalToRomanNumeralsFunc(maxDecimal=4000):
|
|||||||
if last_value <= 3:
|
if last_value <= 3:
|
||||||
solution += (roman_dict[divisor] * last_value)
|
solution += (roman_dict[divisor] * last_value)
|
||||||
elif last_value == 4:
|
elif last_value == 4:
|
||||||
solution += (roman_dict[divisor] * roman_dict[divisor * 5])
|
solution += (roman_dict[divisor] + roman_dict[divisor * 5])
|
||||||
elif 5 <= last_value <= 8:
|
elif 5 <= last_value <= 8:
|
||||||
solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * (last_value - 5)))
|
solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * (last_value - 5)))
|
||||||
elif last_value == 9:
|
elif last_value == 9:
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from .__init__ import *
|
from .__init__ import *
|
||||||
|
import scipy
|
||||||
from scipy.integrate import quad
|
from scipy.integrate import quad
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
22
mathgenerator/funcs/is_prime.py
Normal file
22
mathgenerator/funcs/is_prime.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
from .__init__ import *
|
||||||
|
|
||||||
|
|
||||||
|
def isprime(max_a=100):
|
||||||
|
a = random.randint(2, max_a)
|
||||||
|
problem = a
|
||||||
|
if a == 2:
|
||||||
|
solution = True
|
||||||
|
return (problem, solution)
|
||||||
|
if a % 2 == 0:
|
||||||
|
solution = False
|
||||||
|
return (problem, solution)
|
||||||
|
for i in range(3, a // 2 + 1, 2):
|
||||||
|
if a % i == 0:
|
||||||
|
solution = False
|
||||||
|
return (problem, solution)
|
||||||
|
solution = True
|
||||||
|
return (problem, solution)
|
||||||
|
|
||||||
|
|
||||||
|
is_prime = Generator('isprime', 90, 'a any positive integer',
|
||||||
|
'True/False', isprime)
|
||||||
@@ -1,9 +1,6 @@
|
|||||||
import random
|
|
||||||
import math
|
|
||||||
import fractions
|
|
||||||
from .funcs import *
|
from .funcs import *
|
||||||
from .__init__ import getGenList
|
from .__init__ import getGenList
|
||||||
import scipy
|
|
||||||
|
|
||||||
genList = getGenList()
|
genList = getGenList()
|
||||||
|
|
||||||
|
|||||||
8
setup.py
8
setup.py
@@ -1,12 +1,16 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
setup(name='mathgenerator',
|
setup(name='mathgenerator',
|
||||||
version='1.1.3',
|
version='1.1.4',
|
||||||
description='An open source solution for generating math problems',
|
description='An open source solution for generating math problems',
|
||||||
url='https://github.com/todarith/mathgenerator',
|
url='https://github.com/todarith/mathgenerator',
|
||||||
author='Luke Weiler',
|
author='Luke Weiler',
|
||||||
author_email='lukew25073@gmail.com',
|
author_email='lukew25073@gmail.com',
|
||||||
license='MIT',
|
license='MIT',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
install_requires=[],
|
install_requires=[
|
||||||
|
'sympy',
|
||||||
|
'numpy',
|
||||||
|
'scipy'
|
||||||
|
],
|
||||||
entry_points={})
|
entry_points={})
|
||||||
|
|||||||
Reference in New Issue
Block a user