lp:~yacinechaouche/fortune/trunk

Created by yacine chaouche and last modified
Get this branch:
bzr branch lp:~yacinechaouche/fortune/trunk
Only yacine chaouche can upload to this branch. If you are yacine chaouche please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
yacine chaouche
Project:
fortune
Status:
Development

Recent revisions

14. By Yassine Chaouche <email address hidden>

blank spaces and lines

13. By Yassine Chaouche <email address hidden>

big jumps are colorized.

12. By Yassine Chaouche <email address hidden>

 * Added legends to plots
 * Plot labels are inclined 30° for better spacing
 * Charts are stored in specific Reports directory, created for the purpose.

In utils.py
===========

- Added a new create_label(product_name,x,y) method
- Chanted add_plot accordingly

11. By Yassine Chaouche <email address hidden>

Improved the plotting feature :
 - Every product has its own plot
 - Two plots per page
 - Multiple pages possible

API Changes
The main API of Plotter now is :
- Plotter.plot (product_name,price_list) instead of Plotter.add_plot(product_name,price_list)
- Plotter.show() didn't change

utils.Plotter internal changes:

- init_line_chart becomes create_linechart(pricelist). It automatically creates a linechart, positions it correctly in the upper or the bottom of self.drawing, fills its data and categoryNames.

- save saves the canvas, not the drawing. This allows for multiple pages documents.
- add_line becomes plot. it creates a linechart and adds it to the drawing
- extract_data now returns a formatted version of periods, with lots of empty values to accomodate space.
- show now calls only two methods : save and open.
- some extra methods : format_periods, add_plot, create_drawing
- some extra attributes : self.nb_of_plots
- some attributes aren't needed anymore : data, prodcuts, colors, linechart

10. By Yassine Chaouche <email address hidden>

 * added a preliminary show history/progression/variations/chart/plot (all aliases) function : for now it only shows progression of prices for the products in one chart, but in the future each product will have its own chart.

Changes in fortune.py

- Added a new period attribute for Game (period = season + year)
- do_show accepts new arguments (all aliases) : history/progression/variations/chart/plot
- Stock now has its own History instance for tracking price changes records
- Stock.add_item and Market.variate_price have been modified to accomodate price changes tracking in History
- new Stock.show_variation() method which opens a PDF containing the line charts.
- Added a new History class, used by Stock, which has 3 methods, two of which are used for the moment : add_price and get_prices. The unused one is get_item_prices

Changes in utils.py
new Plotter class, which takes a period at init time but must be fed with successve calls to add_line(product_name,price_list). The two exposed methods of Plotter is add_line and show(). All other methods are used internally (and thus should be underscored...)

9. By Yassine Chaouche <email address hidden>

 * Bugfix : program crashes if player tries to sell a product that is not available in the market anymore.

This bug was resolved by overloading the remove_item method in wealth.

8. By Yassine Chaouche <email address hidden>

 * Added buy max and sell all to the vocabulary
 * Added a new autopilot file, playing with pexpect
 * Fixed some formatting issues in quantities
 * Removed do_list

7. By Yassine Chaouche <email address hidden>

forgot to add those two files.

6. By Yassine Chaouche <email address hidden>

 * Implemented sell
 * Implemented market fluctuation
 * Improved show market and show wealth
 * Created two subclasses Market and Wealth (from Stock), they have different show methods.
 * Improved number formatting (3.000,49 instead of 3000,4930301)

5. By Yassine Chaouche <email address hidden>

 * Fixed multiple formatting issues with floats
 * Implemented simple market fluctuation

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
This branch contains Public information 
Everyone can see this information.

Subscribers