Giter Club home page Giter Club logo

pyvtk's Introduction

  • I'm currently a Staff Software Engineer at Quansight

  • My current interests in Scientific Computing include (see here for technical blogs):

    • Validation of mathematical functions with complex inputs in various libraries such as NumPy, PyTorch, XLA/JAX, Tensorflow, MPMath, etc
    • Theory of Sparse Arrays, in particular, PyTorch sparse tensors support
    • Optimization of Triton kernel parameters
    • Interoperability of Array-like objects from various software
    • Algorithms and Implementations
    • Support Fortran 90 TYPE construct in F2Py
  • I have initiated and co-authored a number of open source projects with the following highlights:

    • RBC - Remote Backend Compiler
    • F2Py - Fortran to Python interface generator DOI, ships with NumPy DOI
    • SciPy - open-source software for mathematics, science, and engineering DOI

    and contributed to a number of open source projects such as XLA, JAX, Heavy.AI, PyTorch, Numba, Apache Arrow, conda-forge, XND, SymPy, etc.

  • My background is in Scientific Research: Mathematical Physics, Nonlinear Waves, Mechanics, Systems Biology, Microscopy, Solid Mechanics, Optics, Scientific Computations, etc. CV@ERIS, ORCID, Scholar

  • ๐Ÿ“ซ How to reach me: Linkedin, GMail

  • Fun facts:

    • I have completed AoC 2019, AoC 2020
    • Estonian Champion 2006 in Dog Obedience (German Shepherd), currently training for Agility (Boston Terrier)
    • Ship engineer by profession, raced with power boats (Circuit S-250, S-350, OSY-400, O-125, F-500), teached sailing to kids
  • ๐Ÿ˜„ Pronouns: standard Modern English

pyvtk's People

Contributors

fangohr avatar pearu avatar psirus avatar takluyver 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar

pyvtk's Issues

Non integer mesh points

What steps will reproduce the problem?
1. Write a mesh ( in my case unstructured) with 'float' mesh points
2. Output VTK file will state that the data is still of type 'int'

Looking at the source I see that 'int' is hard coded in UnstructuredGrid.py in 
line 100

I recommend placing a switch that detects whether the mesh coordinates are of 
type 'int' or 'float' then write the correct string.

I've attached a sample VTK written by pyvtk where the issue may be seen (I left 
it in ASCII format). The error is on line 5 of the sample newTest.vtk

Original issue reported on code.google.com by [email protected] on 25 Aug 2012 at 9:48

Attachments:

unstructured.py example fails with error

Thanks for creating this very useful package.

I am trying to learn to use it by following the examples. When running unstructured.py, I get the following error

      1 vtk = pyvtk.VtkData(  pyvtk.UnstructuredGrid(points,
----> 2     triangle=tri.simplices
      3     ),
      4   pyvtk.PointData(pyvtk.Scalars(pointPressure,name='Pressure')),
      5   pyvtk.CellData(pyvtk.Scalars(cellTemp,name='Temperature')),

/home/rpa/.conda/envs/lagrangian_vorticity/lib/python2.7/site-packages/pyvtk/UnstructuredGrid.pyc in __init__(self, points, vertex, poly_vertex, line, poly_line, triangle, triangle_strip, polygon, pixel, quad, tetra, voxel, hexahedron, wedge, pyramid, quadratic_tetra)
     71                 self.vertex = r
     72             if self._check_int_seq(getattr(self,k),sz):
---> 73                 raise ValueError('In cell %s: must be (seq of seq|seq) integers less than %s'%(k,sz))
     74 
     75         for k,n in self._vtk_cell_nums_map.items():

ValueError: In cell triangle: must be (seq of seq|seq) integers less than 1000

I am not very familiar with the internals of the package, so it's hard for me to debug what is going on.

Exporting Tensors in Python3 - bug and fix

Dear developers,
I found a bug when exporting tensors in Python 3. There is apparently missing conversion from string to bytes. The solution is to fix function Tensors.py::def to_string as

def to_string(self,format='ascii'):
t = self.get_datatype(self.tensors)
ret = [('TENSORS %s %s'%(self.name,t)).encode(),
self.seq_to_string(self.tensors,format,t)]
return b'\n'.join(ret)

This is similar logics as in Scalars.py or Vectors.py at the same functions def to_string().
Regards Vit

Wild .decode make some functions unusable in python3

Hey,

In UnstructuredGrid.py, as for an example, there is a function unstructured_grid_fromfile, the first line calls a .decode() that won't work with Python3, since str are not decode-able.

The Python3 support seems not totally functionnal for now.

A patch would be to use unicode_literals from future in both python2 and 3

Can we have a LICENSE for the package?

I'd like to make PyVTK available through conda-forge, and it would be helpful (maybe required) to have a LICENSE for pyvtk.

I can offer a pull request, maybe with a BSD 3 license, or any other license the author (@pearu) would prefer.

Many thanks,

Hans

Reading vtk binary data

What steps will reproduce the problem?
1. import pyvtk
2. data = pyvtk.VtkData('data.vtk') # This is a binary structured_points dataset

I see that this raises a NotImplemented error.  I am mostly curious to know if 
there are plans to support this in the near term.  I couldn't find a mailing 
list so hopefully this will reach the right people.  

If there aren't plans to implement it, would it be possible to point me in the 
right direction and I'd be happy to take a swing at it.

Thanks,
Sam Skillman

Original issue reported on code.google.com by SamSkillman on 13 Aug 2012 at 4:44

Fix the UnexpectedEOF in the source

The page https://github.com/pearu/pyvtk/wiki/unexpectedEOF suggests a way to fix UnexpectedEOF on files which are conforming to the ambiguous standard for VTK2. 3rd-party projects using pyvtk have to monkey-patch pyvtk to open such files (see https://sourceforge.net/p/mupif/code/ci/master/tree/mupif/VtkReader2.py at the end of the file for a case in point).

This workaround should be either optionally enabled in pyvtk (without monkey-patching), or better yet (as it is safe as far as reading valid input is concerned) change the split(' ') to split() for good so that both variants are readable.

Time series

Thanks for a very useful package.

It might be that I dont understand VTK correctly but I cannot get pyvtk to write results as a time series in a single vtk-file. I have a number of CELL_DATA fields which I would like to see in Paraview as a time series. The only way I can currently make this work is by writing out one vtk-file per field, ie

model_with_field_0.vtk
model_with_field_1.vtk
model_with_field_2.vtk

This duplicates my UnstructuredGrid data which I think is unnecessary (?). Is there a way in pyvtk to get multiple CELL_DATA fields into a single vtk file, or is this not possible in legacy vtk file format? Or is there a way to split UnstructuredGrid-data in one file and then CELL_DATA in separate files?

Thank you and sorry if this is the wrong forum to ask this.

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.