Fortpy

Latest version: v1.7.7

Safety actively analyzes 681866 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 12

1.7.2

- Refined filtering for user-types that get skipped in the `fpy_auxiliary` module generation.
- Fixed a file naming error in the auxiliary module, auto-generated names for array elements were not being trimmed, producing file names with ~100 spaces!
- Improved the search directive for finding the code element corresponding to a user-derived type of a variable.
- Fixed the auxiliary recursion algorithm, which was messing up the recursion context for file name and variable name.
- Added the path to `fortpy.f90` in `code.py` so that the parser can find the source code for fortpy from the distribution directory.
- Fixed issue 64.
- Updated the isense unit tests to allow for auto-parsing of the *latest* version of `fortpy.f90` right from the distribution's `templates` directory. Since the test was written, the signature of `pysave` was updated. This uncovered a bug that could show up: if a person tries to type in more arguments than a function will actually accept, instead of ignoring the error, it would just die.
- Added a best-practices analyzer (`fortpy/stats/bp.py`) and accompanying script (`fortpy/scripts/bestprac.py`) to test for the problems highlighted in enhancement request 68.

1.7.1

- Fixed 66 by adding a conditional check for `pysave` to make sure that an array actually has size before we try to save it.
- Fixed 51.

1.7.0

- Fixed a bug in looking up the fortpy version of files. If binary files were queried (e.g. `.o` or `.mod` files), then it would die in python3 because of the encoding differences. Added compiler suffix checking to the existing checks so that those files wouldn't trigger the exception.
- Fixed a bug for arrays with `D > 2` not being allocated even when `allocate` was included in the `<assignment>` tag.
- Fixed an auto-class bug where folders were only being created for `<targets>` in the _first_ `<test>` tag of the testing group.
- Fixed an auto-class bug with `fpy_coderoot` substitution where an extra `'` was being included and throwing off the string escaping.
- Fixed a bug where if the XML file had a later modified date, a reparse of the module would be triggered every time code ran because the _module's_ datetime was being used for comparison.
- Fixed a bug where auto-generated Makefiles were not valid if no global includes are specified in `config.xml`.
- Added `-strict` option that turns on _all_ warnings for the compiler.
- Fixed a bug in the type parser for recoginizing if the contents are private.
- Changed the auto-class feature to use the new `fpy_auxiliary` module with the `auxsave` and `auxread` interfaces when possible. For variables that have private members, we can't use `fpy_auxiliary` since the `fpy_read` and `fpy_save` can't access the private components from outside of the module that declares those types.
- Added a `summary` file to the file comparison for auto-class `variable.compare` folders. It shows the matches for each file in the directory and which files existed only in the test or model directories, but not both. Useful for tracking down which variables are not matching.

`fpy_auxiliary.f90` Feature Added

As part of the unit testing and development support, `runtests.py` now supports a new option `-auxiliary` that will generate a library-specific module called `fpy_auxiliary.f90`. The module has two interfaces `auxsave` and `auxread` that work in a similar fashion to `fortpy`'s `pysave` and `fpy_read` interfaces. The module procedures for each interface include subroutines to save and re-load _any_ of the user-derived types that are ever declared anywhere in the code library.

For user-derived types that have `pointer` references to instances of the same type within themselves, the `fpy_auxiliary` maintains a global table of pointer addresses and only saves each instance to file once. When the variable is read back from file, the pointers have their targets restored as they were before they were saved. This does _not_ work for mixed custom types. That is, the table is maintained only for pointers to members of the same type as the custom-type being saved to disk.

In order to avoid compilation loops, it is best to define the user-derived types in a separate module from the code that uses them. Then any modules needing the types can also import `fpy_auxiliary` and provide access to `auxsave` and `auxread`. These are useful for generating model input/output from existing codes. For complicated user types, you can add an `auxsave` at any location in the code where the type has been initialized and generate a directory to initialize the variables from for any future unit tests.

Because of the reliance on `c_ptr` from `iso_c_binding`, the code has to be compiled with the 2008 standard, where an array of objects with `pointer` can have any of its elements passed to a subroutine that requires a `pointer` parameter. This modification was made to the `Makefile.*` files that ship with `fortpy`.

1.6.2

- Fixed the bug where the version number of `fortpy.f90` was not updated with Revision 1.6.1. It is now included in the packaging script for `PyPI` so that it won't happen again.
- Fixed issue 56

1.6.1

- Actually, the fix to issue 44 was not committed last revision; but is included now.
- Fixed a bug limiting the reading in of variables greater than 2D, which were not supported before revision 1.6.0.
- Fixed a bug for python3 with `Popen` instances returning `stdout` as byte arrays that need to be decoded.
- With the pre-compilation of `fortpy.f90` included in Revision 1.6.0, `tester.py` was attempting to read the lines in `fortpy.o` and `fortpy.mod` for version information; error raised with UTF-8 decoding.
- In connection with issue 59:
- Added _member_ and _suffix_ attributes to the `<value>` tags.
- Allowed multiple values to be comma-separated for the _value_ attribute of both `<assignment>` and `<part>` tags.
- Added _autoclass_ attribute (to both `<target>` and `<output>`) that generates a folder for a user-derived type and automatically saves the variable's contents recursively in that folder. For `<output>` it tells fortpy to check the _folders_ against each other to determine if the variables are identical.
- Added _autoclass_ attribute to the `<value>` tag for variable assignments. A complex-typed user variable (even one including arrays of user-derived type variables) can be loaded automatically from a folder as long as it matches the file naming conventions.

1.6.0

- As a follow up to issue 35, added more lines of the XML file in which the error occurred and also the file path to the source.
- Fixed a bug where the module parser was adding local variables of _executables_ to its members list if the module didn't have any user-defined custom types.
- Fixed a bug where `allocatable` was being added to any variables receiving initialization from files, even if the size of the array was fixed.
- Updated `fortpy.f90` to include support for fixed-dimension arrays when using `fpy_read`.
- Fixed issue 46
- Fixed issue 45
- Fixed issue 44 by introducing case insensitivity to the `regular="true"` parameter check and by fixing a new bug we discovered where if `dimension` was added as a _modifier_ instead of attached to the variable name, it wasn't being parsed correctly by `parsers.variable`.
- Fixed `fpy_value_count` in `fortpy.f90`. The variable `prev` was having its value set to `0` in the variable declaration, which is only evaluated when the subroutine is first read into memory. Subsequent calls retain their values from previous ones. `prev` now sets is value to `-1` on each call to the routine, which also solves a problem where `adjustl` was not removing leading tabs from the strings that are later cleaned with `trim`.
- Added support for `logical` and `complex` types for `pysave` and `fpy_read` interfaces in `fortpy.f90`.
- Added support for multi-dimensional arrays up to the fortran-max of 7D. Fixes issue 41.
- Added pre-compile support for `fortpy.f90` into `fortpy.mod` and `fortpy.o` for each compiler used in the unit testing. After adding multi-dimensional array support, the `fortpy.f90` file exceeds 10,000 lines and takes 2-20 seconds to compile. Pre-compilation makes sense for lots of quick unit tests: fortpy shouldn't be the bottleneck.
- Fixed issue 3 in `msg-byu/symlib` by printing more digits of the values being compared.
- Fixed issue 48
- Fixed issue 52
- Fixed issue 53
- Fixed issue 50
- Updated additional modules with `2to3` for `python3` compatibility.
- Fixed an issue in `analyze.py` where setting the prompt failed because of the new compiler support.
- Fixed a bug in the analysis shell where tests that have no `.compare.out` file (and thus a `None` percentage) raised an exception when trying to be printed as a percentage.

Page 2 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.