Comments (5)
It's nice to trim down dependencies, but I'm wondering how many people actually want to use this library without the WGS84 ellipsoid. Do you have this use case? Can you tell me more about it?
lazy_static is a very small, common, and well maintained dependency, so I'd guess that it's unlikely to cause any real damage.
More likely, in my estimation, is that some well meaning person will disable all the default features on their dependencies and then wonder why this library no longer works for them.
from geographiclib-rs.
Do you have this use case? Can you tell me more about it?
I have this exact case where lazy_static
seems like suboptimal addition. I'm using geographiclib
only in one part of my library, and thus I'm implementing my own Ellipsoid (much leaner) type which implements From/Into Geodesic
. So I'm not using the internal geographiclib
's wgs84 except for tests.
lazy_static is a very small, common, and well maintained dependency, so I'd guess that it's unlikely to cause any real damage.
That's why I'm not strongly arguing for implementing this change, but rather discussing it as something to consider.
More likely, in my estimation, is that some well meaning person will disable all the default features on their dependencies and then wonder why this library no longer works for them.
Personally, I would assume that mostly experienced Rust users disable default features and expect things to break because of that, and look for the smallest set of necessary features for their use-case.
from geographiclib-rs.
My idea is to add pre-defined ellipsoids (and thus lazy_static) as a default feature. This way no functionality will change for users, but they will be able to use one less dependency when needed.
It is possible just pre-calculate WGS84_GEOD
:
static WGS84_GEOD: Geodesic = Geodesic {
a: WGS84_A
...
};
and add unit test to verify that it equals to Geodesic::new(WGS84_A, WGS84_F)
to catch need of change pre-calculate code if Geodesic::new
would modified.
So it would be possible unconditionally remove lazy_statics
,
and also make code little faster because of there is no need for read/write atomic in every access.
from geographiclib-rs.
Related Issues (20)
- favor type usize for variables that are primarily an array index HOT 1
- add integrated CI testing vs geographiclib C++ implementation HOT 21
- add Karney's standard unit tests HOT 1
- Update benchmarks HOT 6
- resolve test_arcdirect failure HOT 1
- fix test_std_geodesic_geodsolve2 test failure
- fix test_std_geodesic_geodsolve15 failure
- fix test_std_geodesic_geodsolve26 failure HOT 1
- fix test_std_geodesic_geodsolve28 failure
- fix test_std_geodesic_geodsolve29 failure HOT 1
- fix test_std_geodesic_geodsolve76 failure HOT 1
- fix test_std_geodesic_geodsolve78 failure HOT 1
- fix test_geodtest_geodesic_direct12 S12 behavior
- review test_geodtest_geodesic_direct21 lon2 and azi2 tolerances
- fix test_geodtest_geodesic_inverse12 S12 behavior HOT 1
- investigate test_geodtest_geodesic_inverse12 behavior for azi1/azi2/m12
- improve performance HOT 2
- make geomath::norm use &mut arguments HOT 1
- Release 0.2.2? 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 geographiclib-rs.