Code Monkey home page Code Monkey logo

nanonispy's People

Contributors

compphyschris avatar jhellerstedt avatar underchemist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nanonispy's Issues

error: package directory 'nanonispy\tests' does not exist

Hi,

I've got a guy trying to install nanonispy from a git clone/ running install, and it throws the following error:

$python setup.py install
running install
running bdist_egg
running egg_info
creating nanonispy.egg-info
writing nanonispy.egg-info\PKG-INFO
writing dependency_links to nanonispy.egg-info\dependency_links.txt
writing requirements to nanonispy.egg-info\requires.txt
writing top-level names to nanonispy.egg-info\top_level.txt
writing manifest file 'nanonispy.egg-info\SOURCES.txt'
error: package directory 'nanonispy\tests' does not exist

I've been scratching my head looking at the setup.py file but can't offer you any further insight into why its hanging.

Cheers,

Jack

error parsing dat files with duplicitous header entries

Hi,

I managed to take some data with duplicitous header entries (lol nanonis).

So the nap.read.Spec chokes on line 405, because the data footprint of the header is longer than the length of the parsed header, e.g., the return of _parse_dat_header (which doesn't duplicate the entries apparently).

If I replace 405 with:

        f = open(self.fname, 'r')
        ff = f.readlines()
        header_lines = ff.index('[DATA]\n') + 2
        f.close()

It appears to get the right value for header_lines.

New PyPI release

Commit fc91606 is not included in the latest PyPI release, so using Spec is rather annoying because this line is missing.

Could you please push a new release to the PyPI? Thanks in advance!

Extension extraction causes TypeError when using path-like object

For example

from pathlib import Path
import nanonispy as nap

path_to_datafile = Path('/path/to/datafile.3ds')
grid = nap.read.Grid(path_to_datafile)

will fail with a TypeError

TypeError: 'PosixPath' object is not subscriptable

The reason is, well the a PosixPath object is not subscriptable like this

if fname[-3:] != ext:

I will open a pull request to fix that.

UnicodeDecodeError in read_byte

//anaconda/lib/python3.5/site-packages/nanonispy/read.py in start_byte(self)
112 for line in f:
113 # Convert from bytes to str
--> 114 print(line)
115 entry = line.strip().decode()
116 if tag in entry:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xec in position 10: invalid continuation byte

Hi,

I encounter this ~semi-regularly, but can't reliably reproduce it unfortunately. Sometimes adding an 'ignore' in the decode() works, sometimes not.

Incompatible with numpy

np.int, np.float, etc have been deprecated in newer versions of numpy. There is an open pull request to rectify this

Swapping of nx, ny parameters when reading binary data

from david.wander at web dot de

Dear Yann-Sebastien,

first of all, I would like to thank you for sharing your nanonispy library.
It makes the data treatment of my measurements much easier!

However, I just found a major bug in the _load_data function of the Grid class.
Line 230 of read.py (nanonispy Version 1.0.7) reads:

griddata_shaped = griddata.reshape((nx, ny, exp_size_per_pix))

Here you are confusing x and y. The correct code would be:

griddata_shaped = griddata.reshape((ny, nx, exp_size_per_pix))

Of course this then implies that after loading the data, you first have to address y and then x, so for example like this:

grid.signals['params'][index_y][index_x][param_index]

I admit that it is easy to miss this error because it seems to give the right array shapes but if you take a close look, you will realize that when going from
signals['params'][0][0] to signals['params'][1][0] (i.e. increasing the x index by 1), it is actually the y coordinate that changes (signals['params'][1][0][3])
For square shaped grids, this might not be a desaster, as it only leads to a grid rotated by 90° but as soon as you work with other shapes, things get totally messy.

I hope you will correct this in the next version of the package!

Best regards,

David Wander

feature request: multiline comments in .sxm files

Currently, the header information for comment of .sxm-files do not support entries with more than one line; only the first line is taken and the rest is cut off.
This is because the header-entries are split with \n as the delimiter.

EDIT: Saw PR #13 that addresses the multipass entries.

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.