Comments (7)
Let me know if there's anything else I can do to help with reproducibility. Here's some platform information.
Version : 2.7.11
Version tuple: ('2', '7', '11')
Compiler : GCC 4.2.1 (Apple Inc. build 5577)
Build : ('default', 'Dec 6 2015 18:57:58')
from hark.
For reproducibility, let's try this:
- Download and unpack a fresh copy of the repo; right now, the comments-and-cleanup branch has the most up-to-date code.
- Open .../HARK/cstwMPC/cstwMPC.py in Spyder
- Click the green arrow "run" button in the toolbar.
That should run a really small estimation ("beta-point infinite horizon") and tell you that beta=0.9893 or so. You can also try doing this for .../HARK/ConsumptionSavingModel/TractableBufferStockModel.py ... That will take ~1 second and solve the same simple model two different ways.
If the method you used to run the modules and get that error is substantially different than the procedure I described, please tell me what you were doing. If there are other ways to run files that should work but don't work, we want to know.
from hark.
ganong123,
The problem could be your python path. I guess that you ran cstwMPC.py in the cstwMPC folder.
In this case, ConsumptionSavingModel could not be called because the compiler did not know where ConsumptionSavingModel is, unless you inserted the path.
Inserting the path is easy. You can see the command line sys.path.insert(0,'../') in cstwMPC.py
Check your Hark-cloned directory. In my case, I write:
sys.path.insert(0,'/Users/yeabinmoon/Documents/HARK-master/ConsumptionSavingModel')
from hark.
John:
Without making that change, do you get the same error? The lines
sys.path.insert(0,'../')
sys.path.insert(0,'../ConsumptionSavingModel')
are meant to work on every machine, no matter where you put HARK, because it's a relative filepath. The intention is that it adds the directory directly above the current one (which should be the root directory of HARK), and the ConsumptionSavingModel directory off of that one.
from hark.
My understanding on python is not quite good to be honest. But,
Using just command
import sys
sys.path.insert(0,'../')
sys.path.insert(0,'../ConsumptionSavingModel')
did not import ConsumptionSavingModel.py. In fact, I had the same problem before. So I added the direct path, and it worked. I am using Jupyter by the way.
from hark.
I have a guess of the problem. Do:
import os
os.getcwd()
That should tell you the current working directory. Before you run a file, the current working directory should be the one that the module is in. You can change the CWD with os.chdir. If you use Spyder and click the green arrow "run" button, it does a version of this by using the runfile command with the wdir keyword.
We strongly recommend using Spyder, an iPython IDE that comes with Anaconda. Just type spyder at a command prompt after installing Anaconda.
from hark.
(1) I was (and continue to be) working in Spyder
(2) cstwMPC.py already had the snippet
import sys
sys.path.insert(0,'../')
sys.path.insert(0,'../ConsumptionSavingModel')
But this was not sufficient to load the relevant functions.
In any case, switching to comments-and-cleanup branch in my fork resolved the issue. Thanks everyone for your help and I'll continue to report out issues as I find them.
from hark.
Related Issues (20)
- calc_stable_points is being run when it shouldn't be
- ConsBequestModel and related example notebooks HOT 1
- Improve contributor guide with respect to API documentation
- What is update? How many terminal solutions? HOT 8
- Inheritance... HOT 4
- Proposed constructed input framework HOT 11
- Make sure our links are updated to the new doc website
- Should pytest be a requirement? HOT 3
- IndShockConsumerType.calc_jacobian() changes cFunc_terminal_ HOT 4
- Why does PerfForesightLabeled inherit from ConsIndShock? HOT 7
- DeprFac should be DeprRte
- remove FrameAgentType; transfer diagramming functionality over to new Block framework
- HARK.datasets should be moved to HARK.Calibration
- Cannot make a DiscreteDistributionLabeled from a Bernoulli variable HOT 1
- Sequence Space Jacobian Notebook HOT 2
- Problem with pip install econ-ark==0.14.1 HOT 4
- documentation for 'new' models; better docs for 'old' models HOT 2
- Example notebook has an error message HOT 2
- vFunc and vPPfunc are sometimes Null Functions HOT 6
- Econforge interpolation tests are failing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hark.