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)
- mystery windows bug 1/4/2023 HOT 2
- Discretize Method for Discrete Distributions.
- Endpoints for DiscreteDistribution HOT 1
- Faster testing (at least locally)
- Lognormal equiprobable discretization HOT 2
- ConsIndShock with continuous bounds of support
- Serializing HARK Solutions for export/import
- substantive stochastic tests HOT 1
- API documentation not showing up on the site HOT 10
- Edits to example notebook "GenIncProcessModel" HOT 2
- no RTD page for rewards module
- Docs problem
- Edit down ARKitecture docs
- Consistent API for DiscreteDistribution and subclasses (like DiscreteDistributionLabeled)
- RTD Search not working...
- RiskyAssetConsumerType(T_cycle=n) error HOT 1
- Equations not rendering for the "Permanent vs Persistent Income Shocks" example notebook HOT 2
- App that improves diffs in PRs with notebooks HOT 3
- Revisit parallelization in HARK HOT 1
- Renovate Dependency Manager HOT 1
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.