Comments (5)
I wonder if the pretty print should include the attribute labels or not: @tomvanmele @gonzalocasas
Point(1.678, 2.344, 5.754)
orPoint(x=1.678, y=2.344, y=5.754)
At the moment, even the
__repr__
functions are not consistent. For example,Point.__repr__()
- Has the x,y,z whileQuaternion__repr__()
does not.I propose that the str() functions do not carry attribute labels unless it is not obvious; this would allow their printout to be identical to the past. Not only is it easier to read, but fewer changes to the existing docs.
the goal is to have the __repr__
be the same as the __init__
, where possible. i started doing that but certainly missed quite a few...
from compas.
As for the proposal of not including attributes in str, I actually think the new way with attribute labels makes it more readable and despite the fact this means more updates to docs and tests in other packages, I think we should keep them.
from compas.
@yck011522 that would be great!
from compas.
I wonder if the pretty print should include the attribute labels or not:
@tomvanmele @gonzalocasas
Point(1.678, 2.344, 5.754)
or Point(x=1.678, y=2.344, y=5.754)
At the moment, even the __repr__
functions are not consistent. For example, Point.__repr__()
- Has the x,y,z while Quaternion__repr__()
does not.
I propose that the str() functions do not carry attribute labels unless it is not obvious; this would allow their printout to be identical to the past. Not only is it easier to read, but fewer changes to the existing docs.
from compas.
@gonzalocasas @tomvanmele
Do we need some tests for these str methods? I ran into problems (those broken code parts) when I tested them in a console, so maybe a simple test to make sure the str() function actually runs, for example:
test___str__():
p = Polyhedron.from_platonicsolid(12)
str(p)
from compas.
Related Issues (20)
- Built-in support for units
- Intersection functions sometimes do not provide correct results with relative and absolute tolerance HOT 3
- Number typing in GH component HOT 1
- scipy >= 1.1 requirement - windows is able to install only through conda HOT 3
- Intersection methods that accepts tuples. HOT 1
- compas 2 installation error on Mac HOT 9
- code standards enforced by pre-commit hooks HOT 1
- Geometric Key still uses compas.PRECISION HOT 5
- where are the compas.geometry.trimesh* dependencies defined? HOT 15
- Independent Rhino Obj -> Compas Obj converter based on rhino3dm HOT 6
- Cannot convert from Rhino.Point to compas point using `point_to_compas` HOT 1
- Point float arithmetic not mutable?! HOT 2
- [Discussion] Type-consistent through basic math operation HOT 2
- Rhino scripts default install path is wrong for Rhino 8 HOT 5
- `Runtime error (NotSupportedException)` in Grasshopper when using `draw_labels` HOT 2
- RobotModel SceneObject with Python3 in Rhino8 HOT 3
- Transformation of geometry HOT 4
- Fail to install compas in ironpython environment
- Windows and Doors for CellNetwork
- Cannot install Rhino plugin in student lab
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 compas.