Skip to content

Releases: Thierry46/CalcAl

Correction bug Ciqual Reader

18 Jul 18:43
Compare
Choose a tag to compare

Correction bug Ciqual Reader and add unit test for it

CalcAl_v0.55 : 28/7/2018 : use Python 3.7

03 Aug 20:08
eae61e3
Compare
Choose a tag to compare

CalcAl_v0.55 : 28/7/2018 : use Python 3.7

  • 9580 lines py code (include 1901 lines pytest)
  • gui/CalcAlGUI.py: # 21/7/2018 : TMD : Bug correction _tkinter.TclError: expected integer but got ""
  • remove a duplicate unit test function
  • Installer and packager works again on Mac after py2app source code modification
  • Pylint quality : 9.06/10

v0.54 New Ciqual 2017 reader

19 Feb 20:24
86983ab
Compare
Choose a tag to compare
  • New Ciqual 2017 xls databae reader
  • New demo database base on aliment moyen of Ciqual 2017

Modify logging init

05 Feb 20:34
c6dd606
Compare
Choose a tag to compare

CalcAl_v0.53 : 8/5/2017 : Modify logging init

  • 8787 lines py code (include 1489 lines pytest)
  • Suppress -d, --debug option
  • Logging system is now defined in .ini file and can be modified without modifying python code.

Quality review with pylint and flake8 + ergonomy

13 May 09:37
Compare
Choose a tag to compare

CalcAl_v0.52 : 8/5/2017 : Quality and ergonomy

  • 8693 lines py code (include 1409 lines pytest), 4722 statements analysed
  • Pylint : code has been rated at 9.91/10
    • Import BD dialog : file chooser filter according DB type
    • Possibility to cancel Web Browser launching
    • correct bug when importing zipped Ciqual : zipped archive not supported because
      Ciqual table is given uncompressed on ANSES web site.
  • Use decorators for statics functions
  • Use flake8 to check PEPS 8 coding rules.
  • Quality improvements, harden pylints rules in .pylintrc.

Include doc + Mac and Win installer

13 May 09:17
Compare
Choose a tag to compare
Pre-release

CalcAl_v0.51 : 5/3/2017 : Include documentation in project
- French documentation available in directory CalcAl_doc
- New option of menu ? / Documentation that launch documentation in user's WEB browser.
- New Help button in New database dialog

CalcAl_v0.50 : 18/2/2017 : Improve packaging on Mac and correct bugs

  • 8577 lines py code (include 1364 lines pytest)
    • Rewrite package_mac.sh :
      • correct crash in semi-standalone version
      • import the good tinter version in standalone .app
      • parameter to script to build semi-standalone version with -s option.
        • identify .app : standalone and semi_standalone
    • Round group composition values with 1 digit.
    • CalculatorFrame : add buttons :
      • to improve food search, - to clear food selector entry
    • Clean Database/createUserTables() : remove old database updating

CalcAl_v0.49 : 1/2/2017 : correction bug search frame

  • 8547 lines py code (include 1364 lines pytest)
  • Pylint : code has been rated at 9.77/10
    • SearchFood() : correct bug in column order :
      SearchThreadedTask.py/runSearch remove set conversion for listComp
      set is not ordered, but list is ordered when iterating
    • Search frame messages : add constituent names in message
      To see on an hight speed machine, activate debug
    • Message Translation : results, about group…

CalcAl_v0.48 : 18/1/2017 : Installer on Mac and windows
- On windows : Package_win.bat
Create exe with py2exe and package it
Build an installer using InnoSetup
- On mac : Package_mac.sh
- Add background image in .dmg
- Add a link to /applications in .dmg

Ciqual 2016 support

13 May 09:05
Compare
Choose a tag to compare
Ciqual 2016 support Pre-release
Pre-release

CalcAl_v0.47 : 7/1/2017 : Energies recalculated when missing

  • 8509 lines py code (include 1364 lines pytest)
  • Pylint : code has been rated at 9.77/10
    • Add new function : Database/correctEnergyKcal() to correct databases
      when energies are missing.
    • Remove absolute path in package_mac.sh and setup_model.py

CalcAl_v0.46 : 27/12/2016 : correct encoding and accent problems
- in CiqualReader.py : change encoding when reading ciqual ref file :
iso8859-1 -> cp1252
- Bug implementation Tkinter 8.5 with new OS X.12.1 corrected in OS X.12.2
2016-11-18 17:22:15.145 Python[2389:114966] CALayer position contains NaN: [nan 0]
when placing mouse cursor on an empty scrollbar.
- Correct Tk 8.5.18 corrects accents problems causing exception
http://www.activestate.com/activetcl/downloads/thank-you?dl=http://downloads.activestate.com/ActiveTcl/releases/8.5.18.0/ActiveTcl8.5.18.0.298892-macosx10.5-i386-x86_64-threaded.dmg
This version Tk 8.5.18 corrects accents problems causing exception :
libc++abi.dylib: terminating with uncaught exception of type NSException
Install :
Download .dmg, double clic on it
Right-clic on the package + Open + admin password + Continue + Accept licence +
admin password + install Software + Yes + No + Installation Succes + Close
- Correct problem in database/Database.py/getProductsNamesContainingPart() :
capitalise only first car in global search for selecting food with wildcards

CalcAl_v0.45 : 19/12/2016 : Ciqual 2016

  • 8415 lines py code (include 1364 lines pytest)
  • Pylint : code has been rated at 9.78/10
  • Create resources/database/ciqual_2016_constituants.txt table to get components codes
  • Add new components codes in locale/*/componants_shortcuts.txt to get shorctcuts for
    new components : Salt and Chloride
  • Ciqual_2013_Reader -> Ciqual_Reader for reading Ciqual 2013 and 2016 init file
  • Modify database/joinDatabase to add or update components from second DB
    and to deal with product of same name but different code in the 2 databases
  • Correct bug in Energy table when database does not contain alcool component
    ie : USDA SR28 database
  • Log message when deleting a database.
  • Correct Bug in getEnergyRatio() when adding food without energy defined
    or no energy supplied like for water.
  • Correct Bug in EnergyFrame : don’t update when erasing a food in calculator frame.

CalcAl_v0.44 : 3/12/2016 : Test on Pocket PC Windows 7 + Quality

  • 8277 lines py code (include 1364 lines pytest)
  • Pylint : code has been rated at 9.73/10
  • portability on Windows 7 :
    User home detection : package pwd not available
    homeUser = os.path.expanduser("~")
  • Adapt Windows size to tiny computer (Pocket PC)
  • Correct Pylint warnings

CalcAl_v0.43 : 2/12/2016 : Quality review

  • 7980 lines py code (include 1379 lines pytest)
  • Pylint : code has been rated at 9.63/10
  • Solve problem update() of observer overriding tkinter update() method
    Pylint warning : Arguments number differs from overridden 'update' method (arguments-differ)
  • Solve Pylint warning :
    Wildcard import tkinter (wildcard-import)
    Wildcard import tkinter.ttk (wildcard-import)
  • Solve bug missing argument in Module model.CalculatorFrameModel
    ************* Module model.CalculatorFrameModel
    E:166,18: No value for argument 'message' in constructor call (no-value-for-parameter)
    E:208,18: No value for argument 'message' in constructor call (no-value-for-parameter)
    W:213,12: Unused variable 'name' (unused-variable)
    W:213,18: Unused variable 'quantity' (unused-variable)
    W:395,12: Unused variable 'name' (unused-variable)
    W:395,18: Unused variable 'quantity' (unused-variable)
    W:429,12: Unused variable 'name' (unused-variable)
    W:429,18: Unused variable 'quantity' (unused-variable)
    C: 41, 0: standard import "import logging" comes before "from model import Foodstuff" (wrong-import-order)
  • CalculatorFrame : Solve bug when deleting a group : definition Frame not updated :
    family combobox and food name combobox.
  • PatientFrame : add new tooltips
  • When deleting a pathologies, deletes all records related to this pathology in
    patientPathologies table

New patient and pathology frame

13 May 08:56
Compare
Choose a tag to compare
Pre-release

CalcAl_v0.42 : 1/12/2016 : Patient frame

  • 7927 lines py code (include 1380 lines pytest)
  • Pylint : code has been rated at 9.55/10
  • Correct error button label in Pathology Frame
  • Create new tables
  • Get existing patient from portions table to initialise patients
  • Comboboxes for rations frame and dialog
  • Clear not error messages automatically after a delay
  • New banner for frame patient designed by Perrine
  • Disable pathologie definition if multiple pathologies selection
  • Use quality checker Pylint and correct some problems
    python3 -m pylint --disable=invalid-name,unused-wildcard-import,undefined-variable,too-many-locals,too-many-branches,too-many-arguments,too-many-public-methods,too-many-statements,too-few-public-methods,too-many-instance-attributes,too-many-ancestors,too-many-nested-blocks,bad-continuation,line-too-long,unused-argument,bad-continuation *.py /.py > doc/resu_pylint.txt

CalcAl_v0.41 : 25/11/2016 : nbDays stored in portions table

  • 7253 lines py code (include 1380 lines pytest)
  • insert all pathology constituants with only one SQL statement
    in database/savePathology()
  • Update schema of portions table with a new column nbDays (default value to 1)
    in database/Database.py/createUserTables()
    existing database are updating
  • save nbDays in table portions in database.Database/insertPortion()
  • Displaying nbDays when reloading a portion from database
  • Correct bug in CalculatorFrame/changeNbDays() when setting nbDays to 1 (pb test)
  • Correct dates format in portion tables
  • Check date entered by user when saving a portion
  • New button Today in gui/PortionInfoChooser()
  • Tooltip on Date entry in gui/PortionInfoChooser()
  • Check date copied from and old portion : if problem : message warning dialog.
  • New banner designed by Perrine for pathology Frame.
  • Editor for pathology description instead of entry field +
    Reorganisation frames in gui/PathologyFrame.py

CalcAl_v0.40 : 23/11/2016 : Pathology frame

  • 7021 lines py code (include 1299 lines pytest)
  • Correct problem of special component not present in Model when loading a ration.
  • Implement pathology frame

CalcAl_v0.39 : 18/11/2016 : Speed portion display

  • 6387 lines py code (include 1076 lines pytest)
  • Speed portion display when put from Portion frame to calculator.
    by accessing only one time to database and creating Foodstuffs
    and Components without accessing database.

CalcAl_v0.38 : 17/11/2016 : Nb days to eat a portion in Calculator Frame

  • 6296 lines py code (include 1064 lines pytest)
  • Correct bug of bad version in Mac .app info
    package_mac.sh get version number from CalcAl.ini file
  • New combobox in calculator frame for nbDays to eat food if >1 2nd total line
  • CalculatorFrameModel/displayPortion() :Reset components to special component
    to speed up components insertion when displaying a portion in calculator frame.

CalcAl_v0.37 : 13/11/2016 : speed search frame

  • 6218 lines py code (include 1055 lines pytest)
  • Correct bug in CalculatorFrame, unable to change database
    when line of food exist
  • improve speed in Search frame

Refactoring : Publish–subscribe pattern and unit testing

13 May 08:47
Compare
Choose a tag to compare

CalcAl_v0.36 : 12/11/2016 : Refactoring

  • 6046 lines py code (include 1055 lines pytest)
  • Model package to host diet modules
  • Introduce Design Pattern : Publish–subscribe pattern
  • Unit testing : unittest.sh + unittest
  • Add sugar and total energy in energy table
  • Better control of Selection Menu : Disable if no food in table

Mac Packaging

13 May 08:32
Compare
Choose a tag to compare
Mac Packaging Pre-release
Pre-release

CalcAl_v0.35 : 14/10/2016 : Packaging Mac

  • 4404 lines py code
  • new doc file : packaging.txt
  • import path to package inside gui and database with relative path.
  • init.py in package dir gui and database
  • remove directorysrc and move its entries to project base dir
  • Test in Calcal.py if Calcal.ini file is availaible
  • Calcal.py : configApp.read(fileConfigApp, encoding="utf-8") add encoding else crash of app
  • CalcAlGUIMenu/installReader() : bug : add self.configApp.get("Resources", "ReadersDir")
  • Calcal.py/setLocaleCalcal() new function to solve locale setting problems in bundle app
  • Impossible to run plugin import for readers in a Mac app.
    Solution :
    Deliver to users versions with or without plugins by adding or deleting pllugin
    in database directory before packaging Mac app.
  • Speed up portion insertion in calculator frame by adding group of aliments in tables,
    add functions : CalculatorFrame.py/addFoodGroupInTable() and
    TableTreeView.py/insertGroupRow()

CalcAl_v0.34 : 2/10/2016 : Don't write in project directory

  • 4310 lines py code
  • Don't write in project directory but in user's home dir for :
    • Log messages,
    • databases.
  • Avoid code replication between : Database/formatListComponentsValues() and
    Database/formatListQualifiersValues()
  • Avoid portability problem : remove a / in key CalcAl.ini/Resources/ReadersDir
    Create key CalcAl.ini/Resources/SourceDir

CalcAl_v0.33 : 30/9/2016 : speed up

  • 4281 lines py code
  • StartFrame frame :
    bind return keys on database list
    failed to bind doubleclic on database list
  • Calculator frame : speed up insertion of a foodstufff in main table food
    Problem : addTotalRow() exttracts all values for each componant of each foodstuf
    again from database to be summed.
    Solution : Sum values from displayed table and not from database
    TableTreeView : add method getAllColumnsValues()
    Database : add methods formatListQualifiersValues

CalcAl_v0.32 : 28/9/2016 : Portion management

  • 4223 lines py code
  • Portion management
  • User table are now not created by readers,
    but cheched is done each time a database is opened.
    and created in Database/createUserTables()
  • Language detection and translation :
    Hack on Windows : ref : http://python.zirael.org/e-localization4.html
    For gettext.install to detect User language
  • Plugin installation modified in CalcAlGUIMenu.py
  • add more advice on tables Tooltip : Ctrl-c

CalcAl_v0.31 : 18/9/2016 : Thread when search food

  • 3659 lines py code
  • SearchFoodFrame : use thread when searching in database to avoid GUI blocking
  • CalcAlGUIMenu : Add in menu selection of erase item
  • USDA_28_Reader : Capitalize family and product name
  • Change icon for erase line in food calculator : eraseselection.gif