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

Feedback #1

Open
serkor1 opened this issue Mar 25, 2024 · 0 comments
Open

Feedback #1

serkor1 opened this issue Mar 25, 2024 · 0 comments

Comments

@serkor1
Copy link

serkor1 commented Mar 25, 2024

The most elegant solution

"source": [
"%matplotlib inline\n",
"import pyEdgeworthBox as eb\n",
"EB=eb.EdgeBox( u1 = model.utility_A\n",
" , u2 = model.utility_B\n",
" , IE1 = [model.par.w1A,model.par.w2A]\n",
" , IE2 = [model.par.w1B,model.par.w2B])\n",
"EB.plot()"
]

Your edgeworth-box plot is brilliant - it is, however, somewhat messy; it's hard to decipher where the set of Pareto improvements are.

An idea for improvement

"text": [
"p1: 0.500, Error = 0.567\n",
"p1: 0.527, Error = 0.509\n",
"p1: 0.553, Error = 0.457\n",
"p1: 0.580, Error = 0.410\n",
"p1: 0.607, Error = 0.367\n",
"p1: 0.633, Error = 0.328\n",
"p1: 0.660, Error = 0.292\n",
"p1: 0.687, Error = 0.259\n",
"p1: 0.713, Error = 0.228\n",
"p1: 0.740, Error = 0.199\n",
"p1: 0.767, Error = 0.172\n",
"p1: 0.793, Error = 0.148\n",
"p1: 0.820, Error = 0.124\n",
"p1: 0.847, Error = 0.103\n",
"p1: 0.873, Error = 0.082\n",
"p1: 0.900, Error = 0.063\n",
"p1: 0.927, Error = 0.045\n",
"p1: 0.953, Error = 0.039\n",
"p1: 0.980, Error = 0.055\n",
"p1: 1.007, Error = 0.070\n",
"p1: 1.033, Error = 0.085\n",
"p1: 1.060, Error = 0.099\n",
"p1: 1.087, Error = 0.112\n",
"p1: 1.113, Error = 0.124\n",
"p1: 1.140, Error = 0.136\n",
"p1: 1.167, Error = 0.148\n",
"p1: 1.193, Error = 0.158\n",
"p1: 1.220, Error = 0.169\n",
"p1: 1.247, Error = 0.179\n",
"p1: 1.273, Error = 0.188\n",
"p1: 1.300, Error = 0.197\n",
"p1: 1.327, Error = 0.206\n",
"p1: 1.353, Error = 0.215\n",
"p1: 1.380, Error = 0.223\n",
"p1: 1.407, Error = 0.230\n",
"p1: 1.433, Error = 0.238\n",
"p1: 1.460, Error = 0.245\n",
"p1: 1.487, Error = 0.252\n",
"p1: 1.513, Error = 0.259\n",
"p1: 1.540, Error = 0.265\n",
"p1: 1.567, Error = 0.272\n",
"p1: 1.593, Error = 0.278\n",
"p1: 1.620, Error = 0.284\n",
"p1: 1.647, Error = 0.289\n",
"p1: 1.673, Error = 0.295\n",
"p1: 1.700, Error = 0.300\n",
"p1: 1.727, Error = 0.305\n",
"p1: 1.753, Error = 0.310\n",
"p1: 1.780, Error = 0.315\n",
"p1: 1.807, Error = 0.320\n",
"p1: 1.833, Error = 0.324\n",
"p1: 1.860, Error = 0.329\n",
"p1: 1.887, Error = 0.333\n",
"p1: 1.913, Error = 0.337\n",
"p1: 1.940, Error = 0.341\n",
"p1: 1.967, Error = 0.345\n",
"p1: 1.993, Error = 0.349\n",
"p1: 2.020, Error = 0.353\n",
"p1: 2.047, Error = 0.356\n",
"p1: 2.073, Error = 0.360\n",
"p1: 2.100, Error = 0.363\n",
"p1: 2.127, Error = 0.367\n",
"p1: 2.153, Error = 0.370\n",
"p1: 2.180, Error = 0.373\n",
"p1: 2.207, Error = 0.377\n",
"p1: 2.233, Error = 0.380\n",
"p1: 2.260, Error = 0.383\n",
"p1: 2.287, Error = 0.386\n",
"p1: 2.313, Error = 0.388\n",
"p1: 2.340, Error = 0.391\n",
"p1: 2.367, Error = 0.394\n",
"p1: 2.393, Error = 0.397\n",
"p1: 2.420, Error = 0.399\n",
"p1: 2.447, Error = 0.402\n",
"p1: 2.473, Error = 0.404\n",
"p1: 2.500, Error = 0.407\n"
]
}
],

Your market clearing could benefit from being converted into a plot instead of a long list of numbers. Plotting the data is simply more neat, and the narrative is easier to follow.

The hardest section of the code in the project to understand was

I really don't have comments on this. The code is well-written, and well-structured. It definitely gave me some some inspiration for my own code.

This part of the project could be better documented

Your InauguralProjectClass-class should have been documented with details on its parameters and arguments. See for example the following as an inspiration,

def function(self, good, price):
    """
    The function returns the demand for the chosen
    good in the first the defined class.
    Args:
        good: A list of integers representing the demand for the good
        defined initially
        price: A list of intergers representing the price for each
        good.


    Returns:
        The total demand for the good 1 or 2


    """
    # 1) coerce good and price
    # to numpy arrays
    good = np.array(good)
    price = np.array(price)


    demand = self.fraction * sum(price * good) / price[self.good - 1]


    return np.maximum(demand, 0)

From this project

This will help readers of your code, and your future selves.

An idea for an improvement/clarification could be

If anything, I would opt for vectorized-code over for-loops where possible - this can easily be achieved by using numpy, and will increase efficiency and speed of your code.

An idea for an extension could be

A requirements.txt so your modules can easily be installed. See, for example, this guide on how to implement this.

Alternatively, I would write all used modules in the README with the associated code to install these.

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

No branches or pull requests

1 participant