sandialabs / exodusii Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
exodusii/element.py is missing support for Tri3 elements even though it has support for Tet4 elements.
Upon trying to send in pathlib.Path
objects to exodusii.exo_file()
I end up getting an error in glob.glob()
that kind of says what the problem is but isn't very user friendly to newer python developers.
I'd like to get full support for pathlib.Path
objects or a strong type check on the files with a well-written error message. It seems that it is possible to put stars and question marks in pathlib.Path
objects, so maybe all we need to do is cast pathlib.Path
to str
if we encounter any?
>>> p = pathlib.Path("foo/bar.?.*")
>>> p
PosixPath('foo/bar.?.*')
>>> p.resolve()
PosixPath('/Users/mswan/foo/bar.?.*')
>>> str(p)
'foo/bar.?.*'
Other than testing the new feature, an implementation would be this:
mswan@cee-pp-ldrd02 $ git diff __init__.py
diff --git a/exodusii/__init__.py b/exodusii/__init__.py
index 19e62be..c696f7f 100644
--- a/exodusii/__init__.py
+++ b/exodusii/__init__.py
@@ -32,9 +32,13 @@ exo_file = File
def _find_files(*files):
import glob
+ import pathlib
found = []
for file in files:
+ if isinstance(file, pathlib.Path):
+ found.append(str(file.resolve()))
+ continue
globbed_files = glob.glob(file)
if not globbed_files:
raise FileNotFoundError(file)
seacas/IOSS calls simple 3d simplicies "tetra4". Add this to the list of supported tets.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.