Comments (9)
Alt: return None or object
from dxtbx.
=> not really an API change... I think this is a good idea and would probably help (though we do have caching in there so it is not actually going back to spinning rust to check next time... I believe)
from dxtbx.
from dxtbx.
Anything derived from Format?
_cache_controller = dxtbx.filecache_controller.simple_controller()
@classmethod
def get_cache_controller(cls):
return cls._cache_controller
header of referenced class contains
# A shared caching layer for file-like objects.
# pseudo_file objects can be used as drop-in replacements for actual file
# handles to provide a transparent caching layer to avoid reading multiple
# times from disk or network.
#
# To create a pseudo_file instance, encapsulate a 'real' file handler
# inside a lazy cache object:
# from dxtbx.filecache import lazy_file_cache
# cache = lazy_file_cache(open(filename, 'rb'))
#
# Finally use a reference to the cache object to create one or many pseudo_file
# instances:
# fh1 = cache.open()
# from dxtbx.filecache import pseudo_file
# fh2 = pseudo_file(cache) # equivalent
# fh3 = pseudo_file(cache)
# ...
#
# Each pseudo_file instance can then be treated as a proper read-only
# file handle, but will benefit from a shared cache:
# with cache.open() as fh:
# fh.read(100)
# fh.readline()
# fh.seek(500)
# fh.read()
# fh.readlines()
# fh.close()
#
# To flush the cache and free the memory you can use
# cache.close()
# This will drop the cache when all associated file handles are closed.
# To instantly drop the cache you can use
# cache.force_close()
# Any further access attempts will then result in an exception.
from dxtbx.
It is true however that your mechanism could avoid re-parsing text in headers which would be a good thing
from dxtbx.
from dxtbx.
@Anthchirp can probably chip in here but I was under the impression that everything is using it - at least for regular formats (CBF, rayonix etc) - however it is buried under a load of metaclass witchcraft...
from dxtbx.
from dxtbx.
but return object or None could be a useful motif to keep anyways...
from dxtbx.
Related Issues (20)
- EIGER X 16M at SPring-8 BL41XU HOT 9
- [3.17] error: ‘uint32_t’ does not name a type HOT 2
- [3.17] seems incompatible with Python 3.12 HOT 5
- [3.17] : DeprecationWarning: SelectableGroups dict interface is deprecated.
- [3.17] PytestUnknownMarkWarning: Unknown pytest.mark.regression
- Support for Rigaku Arc detectors HOT 5
- Generalise support for dynamic shadowing in dxtbx HOT 1
- NXmx bugs
- `FormatEigerNXmxFilewriter.get_raw_data` fails when number of linked data files is large HOT 3
- dxtbx.format.FormatNXmxDLS16M.FormatNXmxDLS16M no longer supports legacy data without VDS
- `FormatSMVADSCmlfsom` is too promiscuous HOT 1
- dlsnxs2cbf: produces invalid files from i04-1 Eiger 9M HOT 10
- More general support for handling of hit indices
- Define what we mean by array range HOT 11
- Treat everything internally as count-from-zero
- Figure out what is needed to remove image range
- Rename get_array_range -> get_z_range HOT 1
- Create branches in dxtbx and dials to explore impacts of removing image range etc. HOT 1
- Setting `geometry.goniometer.axis=` for a multi-axis goniometer should be disallowed
- FullCBFWriter shuffles multiple panels HOT 3
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 dxtbx.