Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add base tests for core.HARKobject, core.distanceMetric, core.AgentType #401

Merged
merged 15 commits into from
Oct 3, 2019

Conversation

MridulS
Copy link
Member

@MridulS MridulS commented Sep 28, 2019

Started adding tests for the classes and functions in core.py

Made some changes to the core.py itself as I found a couple of bugs in the code.

  • a logic bug(typo) in distance metric 9563bcf
  • a statement which will throw an error, thing_A.shape - thing_B.shape won't work as both are tuples, changed it by using flatten and then comparing lengths. 24dea3e
  • removed certain instances of exec() and eval() as there are other ways of doing the same thing

@mnwhite @llorracc

@MridulS
Copy link
Member Author

MridulS commented Sep 28, 2019

NOTE: This PR will make HARK incompatible with py2 as I am using the exploding dictionary d = {**dict_1, **dict_2} statement which was introduced in python 3.

[Hence the Travis Fail]

@llorracc
Copy link
Collaborator

@MridulS, I guess the "failing check" is failing because of py27 incompatibility?

Are the circs simple enough that you could just do a test for py27 and give an error message to the user, but the code would pass Travis? We have said we're going to abandon py27 in January, but we're not quite there yet ...

@MridulS
Copy link
Member Author

MridulS commented Sep 29, 2019

@llorracc yeah I can change the code so it works with 2 as well as 3, this is just a cleaner way of combining 2 dictionaries (syntax available from python3).

@llorracc
Copy link
Collaborator

llorracc commented Sep 29, 2019 via email

@MridulS
Copy link
Member Author

MridulS commented Sep 29, 2019

Scratch my previous comment, there is a better way without using py3 specific syntax :)

@MridulS
Copy link
Member Author

MridulS commented Sep 29, 2019

Travis should be happy now !

@MridulS MridulS changed the title [WIP] Add base tests for core.* Add base tests for core.HARKobject, core.distanceMetric, core.AgentType Oct 3, 2019
@llorracc llorracc merged commit 90989ed into econ-ark:master Oct 3, 2019
@llorracc
Copy link
Collaborator

llorracc commented Oct 3, 2019

Release Note: Add unit tests to HARK.core various items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants