Giter Site home page Giter Site logo

ng.pipe.make_uc() type error about nmrglue HOT 6 CLOSED

jjhelmus avatar jjhelmus commented on June 30, 2024
ng.pipe.make_uc() type error

from nmrglue.

Comments (6)

jjhelmus avatar jjhelmus commented on June 30, 2024

@hadwin-357 What version of NumPy do you have installed? I believe some of the recent releases are more strict about automatic type conversion.

from nmrglue.

reneeotten avatar reneeotten commented on June 30, 2024

I ran into a similar issue today with NumPy version 1.18.1. The problem is that linspace does not accept floats anymore for the number of samples to generate (this is the upstream NumPy commit).

Explicitly converting that argument to a int everywhere would work, but perhaps making sure that ._size is an integer makes more sense. The issue for me can be resolved by changing
self._size = size to self._size = int(size) on line 76 of fileio/fileiobase.py.

from nmrglue.

reneeotten avatar reneeotten commented on June 30, 2024

as a side-note there are two additional warnings about code in fileio/fileiobase.py:

/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nmrglue/fileio/fileiobase.py:388: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if unit is 'ppm':
/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nmrglue/fileio/fileiobase.py:391: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif unit is 'hz':

If you want I can make a PR to fix these at the same time.

from nmrglue.

jjhelmus avatar jjhelmus commented on June 30, 2024

@reneeotten Thanks for looking into this issue. I agree, the size argument should be cast to an integer. I've implemented this and changed to string comparison to use an equality in #114.

In the future feel free to submit PRs for issues like these, I'd be happy to review them.

from nmrglue.

reneeotten avatar reneeotten commented on June 30, 2024

thanks @jjhelmus - I will submit a PR in the future. Are you planning to tag/release a new version soon-ish?

from nmrglue.

jjhelmus avatar jjhelmus commented on June 30, 2024

Are you planning to tag/release a new version soon-ish?

It is about time for a release. I'll tag one later this week.

from nmrglue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.