Comments (3)
Getting the input and outputs into a single file would be very nice except for the fact that if we went that way the only way we would be able to build input files for our unit tests would be to use fortpy. This would be inconvenient when we use things like mathematica to develop unit tests (which I have been doing for some of subroutines I've been testing). So even if it's less convenient I think the more generally accessible option is to use the first option and save/read the array's in slices.
Another possible option would be to have fortpy support either format, HDF5 or slices and have the user add a modifier to the input/output tag that would tell it which of the two it needed to use.
from fortpy.
For the short term, we are going to just handle the arrays in plain text and leave the HDF5 for now. We will reserve the double pound symbol ##
as the indicator for array shaping information. This is how it will work:
## 3 2 2
## 1,:,:
0 1
1 0
## 2,:,:
-1 1
1 -1
## 3,:,:
2 3
4 5
- The first line specifies the total shape of the array that can be used for allocating it in memory. It is just a list of the dimensions in the order that they would be entered in Fortran directly.
- The multi-dimensional array is specified in blocks of 2D arrays. Each 2D array block should be preceded by the index specifying where its data should be copied. Fortpy will splice the exact form of the index into the variable name on the left of the assignment.
variable(3,:,:) = read(values)
.
This file format should be able to handle arrays of any dimension. In order to implement this, we will need:
- Additions to the interfaces
fpy_read
,fpy_read_p
andfpy_read_f
that accept variables of dimensions 3 through 7 (which is the maximum supported dimensionality in fortran). - Additions to the
fpy_save
interface for dimensions 3 through 7 that writes out in this format. - A new file template for
integer.xml
andfloat.xml
that handle the multi-D format.
At this point, it may be worthwhile to write a python module that can create the fortpy.f90
file without making errors. Then we will have uniformity across the implementation when the only differences are adding/removing allocatable
or pointer
modifiers. This will also allow the problem with logical
not being supported to be addressed easily as well as complex
types in the future, where the values have to be separated in real and imaginary parts.
from fortpy.
Support available from Revision 1.6.0
from fortpy.
Related Issues (20)
- Camel Case in module name
- Extra space between xml documentation and subroutine declaration
- Modifiers in assignment block inside of test block in the xml don't get recognized.
- Type declaration failure.
- Precompiler Parsing Issue HOT 1
- Case sensitive file names
- Module import error
- Error thrown by unit test isn't string HOT 1
- Allow user to define tests that should fail or throw errors
- If fortpy was compiled with a different version of gfortran we should catch it and recompile rather than failing.
- autovar failure HOT 1
- Blank lines in summary tags break parser.
- Create staging directory automatically if it doesn't exist HOT 1
- Possibility to opt out of autoconversion of derived-type . (dot) to % (percent) HOT 1
- Add a "return" to the single line in the SUCCESS file HOT 1
- Warn when `FORTPY_CONFIG` is not set or when fortpy.config.xml is present (whenever `runtest.py` is called) HOT 1
- Makefile doesn't work on mac OSX when the compilation fails, probably regex's aren't consistent HOT 1
- Better output when compiling fortpy-created programs HOT 1
- Failure to allocate `perm` in routine `find_permutation_of_group` before calling HOT 4
- Error in symlib unittests. Fortpy declare pointer, but the variable should be an "allocatable" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fortpy.