Accéder au contenu principal

[Python] CCodeInline to replace np_inline.

An home-made design, not Warning, no exception enter in 500 lines and can merely compile everything in C. Designed to be more like C++, np_inline is a Boiler plate extracted from bare-bottom python doc

where my Actual development of CCodeInline is a class implementation of the same idiom... Adding possibility to upgrade the skeleton, it also come with possibility to add Include header ( what was really missing inside the Initial boiler-plate of a good C extension of Python compiled code )

Some other story from my github can also comment more on development and what was achieved... But on 3 days of works it merely show a same-to-same comparison be achieved... Parsing is 90% complete and the inherent design like writing the code inside a temporary-path, building and loading module with imp is 100% ported from my class design... A Big Plus, More than one code can be inserted in a skeleton, and Include list ( Should ) follow... Example from the file inside the __main__ demonstrate it's capacity to keep the merged/parsed information and can be switched from a current skeleton to another...

So maybe another fews days, and the code will support many Parameter in entry, C/C++ function will have a choosen C/C++ parameter before compiling, Header-file will be fully integrated and Function itself will not throw an assert on entry-function parameter being only Int or float, PyObject, String and many more parameter will be accessible...

Also planned to be released on pypi.python.org, this one will be up and growing...


Example of Managing a Skeleton with CCodeInline:

Managing the Skeleton

    
### Main example to define some code , some skeleton-Index and calling the
### inline_debug .
    
BInlineCode=r'''printf( "Program #%i: Hello world.\n", i ) ;'''
BCode = CCodeInline( args=(1, ), py_types=(( int, 'i'),)  )
### Note, the object is ready and we only need to define a Skeleton
### with property SkeletonIndex
BCode.SkeletonIndex = 1
BCode.AddSkeleton
### Also good if you do Errors by calling BCode.GenerateCode and parse tag and
### and realize there is an error inside the result, re-add the
### skeleton like this step to Initialize a Skeleton
### Just to sneak-out what inside to print a Generated/Parsed Skeleton
### you can call BCode.VarDefSkeleton property which is the active
### variable manager for current Skeleton
print BCode.VarDefSkeleton
### Don't forget to add the code:
BCode.FCCode = BInlineCode
### Did you add a malloc somewhere in your code.. Still need to add
### an Header ...
BCode.IncludeHeaderType = 'internal'
### IncludeHeaderType one of two words, 'internal', 'external'
### Based on Standard, an internal header will be handled like this : #include <...>
### and external-one will look like this : #include '...'
BCode.DictIncludeHeader = 'stdlib.h'
### Updating the Header list ready for parsing.
BCode.UpdateIncludeHeader
  
### If you do like to see once again, call GenerateCode and you will see appear it inside
### the Include-Header section...
BCode.GenerateCode()

XText may contains errors, syntax errors or lexical error...
XNow with SpellChecking and Editable text. Up to you to get something correct.


  • 1No Interest
  • 2Somewhat good
  • 3Good
  • 4Special.

Posts les plus consultés de ce blog

Hottest Snapshoot from my ThF4_LaFe Hard-State Nuclear Holdrum

This is my ThF 4 + LaFe (α-Fe) Nuclear Holdrum ( more than quantic-one ), for it's hard-state design. It's the revealed reproduction from 1980, after seeing the images with my tiny eyes from M.Villeneuve having a snapshoot from the Psychiatric hives, or vault. It was forbidden to stole because it was not yet made at this moment... To reproduce the image on the picture, they use white paint on the Xenon tube on external side of the holdrum... In fact this is PTFE thread used and it have it's property... Ionisation from PTFE thread is mildly-helper driving photo-source like filter-to-filter of a « ridicule » quater-plate effect side of using Fluor in light filtering, while in high-energy and high velocity light it en-lighting prior to filter... In This case  it's good, we are dealing with Ultra-violet led PaInSe ( also know as Hard-state gamma-ray pulse led from Praseodymium/Indium with filter to throw down wavelength to UV region...   ). I can conclude it's 5 xeno...

Oups, The AME 2012 Atomic Mass Evalutation fall in my Hand...

 I don't know what Zantagor, a real fanatic of Japanese / Chinese games told me about the Word Downloading in Japanese, but during I was looking to update data toward my Python module names NuclearMassTable from masstable having a lot of inexact information behind nndc.bnl.gov, but this PDF just fall in my hand when I was trying to seek for a document from cpc-hepnp.ihep.ac.cn , which is the type of hack-site not made to be KANJI-prone and backend still in english... The AME2012 Atomic Mass Evaluation Some content in Image.. Sorry my ImagePathDesign is not ready, but orcad give about perfect conversion and PDF2DJVU seems to work fine with... Few example about the content : Units; recalibration of α- and γ-ray energies Atomic mass determination for a particular nuclide can be generally performed by establishing an energy relation between the mass we want to deduce and that for a well known nuclide. This energy relation is then expressed in electron-volts (eV). Mass value...

My Xeon got afraid of it so it have run it out.

 Yes, there is an alternative to make Windows working. It's changing inside bios inside "CSM" section which have it and some item where left into "UEFI" and not auto-detect between "UEFI" and Legacy and does support Windows installation.    With such speed.   Belong to images it's my "DDR4 ECC" memory which are 2x 16 Gigabytes at 2133 Mhz that is actually running at 2194 Mhz, so close to processor speed which is 2.2Ghz. And it's only what is supported in overclock-ability the memory is pushed hard. Pushed at 103% of it's clock it might be the reason sometime it shut down silently or simply doing a task and shutdown. Except in Linux Min Xia installation it reboot before it end the loading of all the module. But exceptional it can last for 10 hours long formatting a Tera Byte ( out of it's 8 days of formatting ) and by using the Linux Mint installer of Xia ( which is the previous version of Linux Mint ). Apparently Virginia or W...