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

Postprocessor newline issue #3

Open
nickrsan opened this issue Aug 14, 2020 · 9 comments
Open

Postprocessor newline issue #3

nickrsan opened this issue Aug 14, 2020 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@nickrsan
Copy link
Member

Hi @msdogan,

I just pushed a new version of the postprocessor code (82930a4) to this copy of the calvin repository (not the CWS one). Can you give it a try and see if it resolves the extra newlines on the windows exports for you and then also check and make sure that it doesn't have any unintended side effects on Mac? I tried related code on Windows and Linux with success, but didn't run this actual script, so I'd be curious if it runs correctly on Mac, etc. Thank you!

@nickrsan nickrsan added the bug Something isn't working label Aug 14, 2020
@nickrsan nickrsan self-assigned this Aug 14, 2020
@mlmaskey
Copy link

@nickrsan and @msdogan, I added new lines on this module as follows
Adding new lines to export more information such as objective function values, the matrix of unit cost, and target demand.

Modified lines: 92-94, 139, 147-151, and 180-182

These new features allow the end-user to investigate the objective function values at each link and time step as well as compare the target demand vs supplies.

Mahesh Maskey August 15, 2020

@mlmaskey
Copy link

@nickrsan
If it is feasible could you please push to the calvin repository.
Thanks

@msdogan
Copy link

msdogan commented Aug 16, 2020

@nickrsan I tried on Windows and it runs great, no blank lines. I will try with Mac and let you know.

@msdogan
Copy link

msdogan commented Aug 17, 2020

I got following error when I tried on Mac.

  File "/Users/msdogan/Documents/github/WSMcalvin/main-annual.py", line 9, in <module>
    calvin = CALVIN('calvin/data/annual/linksWY%d.csv' % i, ic=eop)
  File "/Users/msdogan/Documents/github/WSMcalvin/calvin/calvin.py", line 34, in __init__
    if not self.log.hasHandlers():  # hasHandlers will only be True if someone already called CALVIN with the same log_name in the same session
AttributeError: 'Logger' object has no attribute 'hasHandlers'

[Finished in 9.6s with exit code 1]
[shell_cmd: python -u "/Users/msdogan/Documents/github/WSMcalvin/main-annual.py"]
[dir: /Users/msdogan/Documents/github/WSMcalvin]
[path: /Users/msdogan/anaconda/bin:/Users/msdogan/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin]```

@nickrsan
Copy link
Member Author

Hi Mustafa,

Hmm, any chance that was run using Python 2, or a very old version of Python 3? That error message suggests an old version of Python. If we still need to support Python 2 though, I'll need to change the code - for Python 3, I'd suggest upgrading Python to a newer version.

If you'll be using this computer today, it's probably best to revert to the previous version from Git, but I think you're using a Windows computer for the training? See you momentarily

@msdogan
Copy link

msdogan commented Aug 17, 2020

Hi Nick,

That's is Python 2.7 installed on my Mac. I will be using Windows for the workshop.

@nickrsan
Copy link
Member Author

OK - do you think we'll want to keep Python 2.7 compatibility or is it OK to drop it? I'll also ask Jon in a pull request.

@msdogan
Copy link

msdogan commented Aug 18, 2020

Well, it is no problem for me to uninstall Python 2.7 and install 3+. But I believe Jon uses Python 2.7 version.

@msdogan
Copy link

msdogan commented Aug 18, 2020

Hi @jdherman, do you think we should keep Python 2.7 compatibility?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants