Comments (4)
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
The whole way of choosing the current project is pretty crap. How was this not a function from the beginning?
What do you think about the following:
#!python
class ProjectManager:
@property
def current(self):
return self._project
def set_current(self, name, writable=True):
self._project = project
if writable:
self._lock = InterProcessLock(os.path.join(self.dir, "write-lock"))
self.read_only = not self._lock.acquire(timeout = 0.05)
else:
self.read_only = True
I don't know if .set_current()
is better than .set()
... but I am totally OK with making choosing a project an explicit function, and then being able to pass writable=False
.
from brightway2-data.
Original comment by Tomas Navarrete Gutierrez (Bitbucket: tomas_navarrete, ).
I vote for set_current()
For the rest, it looks good to me.
from brightway2-data.
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
Change how to set projects. Fixes #39
from brightway2-data.
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
Fix is in version 2.2, on pypi now.
from brightway2-data.
Related Issues (20)
- Raise an warning when saving new `Process` nodes with type `technosphere` or `biosphere` HOT 1
- Error when loading bw2data: module 'numpy' has no attribute 'bool' HOT 1
- Peewee errors in CI on Windows HOT 1
- Don't require `bw2calc`
- Moving to `bw_projects` needs a migration HOT 2
- Current test decoraters or base test class pollute project directory HOT 2
- missing vacuum attribute HOT 10
- Are concurrent database modifications supported in Brightway? HOT 1
- AttributeError: 'Config' object has no attribute 'is_test' HOT 2
- Can only join an iterable error while writing database to brightway2 HOT 2
- bw2data fails to migrate project to 4.0 format HOT 1
- data_store method opening too many files
- Create migration for pickle fields to save data in JSON
- move to cookiecutterlib HOT 1
- Use `Levenshtein` if installed
- bw2setup fails on latest version
- compat error for method missing is not helpful
- Allow LCIA methods to refer to biosphere flows which don't exist HOT 2
- Add requirement to fs module HOT 2
- Why no more pure Python wheels of `bw2data` on PyPi? 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 brightway2-data.