Giter VIP home page Giter VIP logo

Comments (9)

cc7768 avatar cc7768 commented on July 28, 2024

Just a reminder, if you work on tests at all, please mark them out so we don't duplicate work. Feel free to work either through a fork or the tests branch (whichever is applicable), but regardless please comment here on what you are working on.

from quantecon.py.

sglyon avatar sglyon commented on July 28, 2024

I have written a few tests for the asset pricing module, but need some help.

I am trying to think of a very simple example that we can "know" the answer to so that I can check the accuracy of the lucas_tree, consol_price, and call_option methods. Does anyone have any ideas?

from quantecon.py.

sanguineturtle avatar sanguineturtle commented on July 28, 2024

#45 Test Branch Merged.I have one more item before this issue is closed.

For the examples\ folder which contains the website code, I am looking through them to see if a few tests need to be written to ensure the website examples remain consistent etc. Any thoughts on the following:

  1. plot_directives: these contain an explicit link between the plot python file and the output of the embedded graphic in sphinx. Therefore these probably don't need testing. Any changes would be captured in changes to the underlying py file.
    @jstac do you want to know if the graphics change from what is currently shown? If so we could use md5hash's of the generated plots. For example 3dplot.pdf has checksum fb0eb23d8821237fa519057c5480d88b but this would then flag a change notice when 3dplot.py might be changed for some valid reason (updating colors etc). The alternative is not pretty (http://matplotlib.org/devel/testing.html)
  2. Given the underlying test coverage of the formal QuantEcon package. Perhaps a runtime test is all that is really needed to ensure the examples have been updated as the API changes in QuantEcon etc.
    @jstac There are some files that contain functions in the examples folder. An example is: ar1sim.py has functions proto1, proto2, ols_estimates and ope_estimates. Would you like these to be tested with the example input which has been written for the website (i.e. using theta=0.8, num_reps=100000, n = 1000 and x_obs=proto2(....) and checking those functions produce expected output?

from quantecon.py.

jstac avatar jstac commented on July 28, 2024

@sanguineturtle Thanks for looking into this. Just a runtime test for examples is completely fine. No need to do anything beyond that. In fact the ar1sim.py file was something I threw together that doesn't actually get used anywhere.

from quantecon.py.

sanguineturtle avatar sanguineturtle commented on July 28, 2024

I have pushed a new tests branch to the repository. I am still trying to figure out the best way to suppress matplotlib figures and capture stderr when each file executes to report back in an assert Message. Currently this test runs but doesn't "work" as the stderr and stdout are streamed into the terminal screen.

I have posted a stackoverflow question on this topic: http://stackoverflow.com/questions/25215477/supress-matplotlib-figures-when-running-py-file-via-python-or-ipython-terminal

Any thoughts would be most welcome.

from quantecon.py.

jstac avatar jstac commented on July 28, 2024

@sanguineturtle Can we close this?

from quantecon.py.

sglyon avatar sglyon commented on July 28, 2024

Ping

from quantecon.py.

sglyon avatar sglyon commented on July 28, 2024

@mmcky is this ready to close?

from quantecon.py.

mmcky avatar mmcky commented on July 28, 2024

Closing as we have some basic test infrastructure in place to run the examples.
We can improve this later on possibly with: https://github.com/paulgb/runipy

from quantecon.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.