Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enabled 'np.power' -> exponent, and also enabled replacing simple dec… #7

Merged
merged 5 commits into from Jun 15, 2018

Conversation

alexhagen
Copy link
Contributor

@alexhagen alexhagen commented Jun 8, 2018

…imals with their fractional representation

now

x = -0.5

becomes

$$x ={- \frac{1}{2}}$$

and

x = np.power(1, 2)

becomes

$$x = \left(1\right)^{2}$$

and

x = 1.

becomes

$$x = 1$$

@erwanp
Copy link
Owner

erwanp commented Jun 10, 2018

Hello, and thanks for the suggestions! I got three remarks

  1. You'll need parenthesis around the
except (IndexError, ValueError):

for it to pass the tests.

  1. The simplifications of power and 1. are great, let's include them!

  2. However, I wouldn't simplify 0.5 as 1/2 by default. Sometimes you just want things to stay compact. Furthermore, if you have 1/2 in your Python/Fortran expression it will be converted to $$x ={- \frac{1}{2}}$$ already.

What do you think of that?

@alexhagen
Copy link
Contributor Author

Great, I'll work on that tomorrow. It's your choice as far as the fractions go, so I'll defer to you there.

@codecov-io
Copy link

codecov-io commented Jun 14, 2018

Codecov Report

Merging #7 into master will decrease coverage by 2.58%.
The diff coverage is 36.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #7      +/-   ##
==========================================
- Coverage   75.88%   73.29%   -2.59%     
==========================================
  Files          13       13              
  Lines         539      573      +34     
==========================================
+ Hits          409      420      +11     
- Misses        130      153      +23
Impacted Files Coverage Δ
pytexit/pytexit.py 83.63% <ø> (ø) ⬆️
pytexit/core/core.py 75.29% <36.84%> (-4.71%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d0d063f...81fa728. Read the comment docs.

@erwanp
Copy link
Owner

erwanp commented Jun 15, 2018

Great, merging it!

@erwanp erwanp merged commit bc9cbfd into erwanp:master Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants